Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmake/modules/cli11.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
option(USE_BUNDLED_CLI11 "Enable building of the bundled CLI11" ${USE_BUNDLED_DEPS})

if(USE_BUNDLED_CLI11)
include(FetchContent)
FetchContent_Declare(cli11
URL https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.4.1.tar.gz
URL_HASH SHA256=73b7ec52261ce8fe980a29df6b4ceb66243bb0b779451dbd3d014cfec9fdbb58
)
FetchContent_MakeAvailable(cli11)
else()
find_package(CLI11 CONFIG REQUIRED)
endif()
5 changes: 3 additions & 2 deletions cmake/modules/yaml-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ option(USE_BUNDLED_YAMLCPP "Enable building of the bundled yamlcpp" ${USE_BUNDLE
if(USE_BUNDLED_YAMLCPP)
include(FetchContent)
FetchContent_Declare(yamlcpp
URL https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz
URL_HASH SHA256=fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
GIT_TAG yaml-cpp-0.9.0
GIT_SHALLOW ON
)
FetchContent_MakeAvailable(yamlcpp)
else()
Expand Down
28 changes: 21 additions & 7 deletions scripts/completions/bash/sysdig
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,40 @@ _sysdig_complete()
-D \
--debug \
-e \
--events \
--event-limit \
-E \
--exclude-users \
-F \
--fatfile \
-G \
--seconds \
-H \
--plugin \
-I \
--input \
-i \
--chisel-info \
-h \
--help \
-j \
--json \
-k \
--k8s-api \
-L \
--list-events \
-l \
--list \
-lv \
--list-markdown \
--libs-version \
--log-level \
--color \
--filter-proclist \
--gvisor-config \
--gvisor-root \
--gvisor-generate-config \
--plugin-config-file \
--plugin-info \
--large-environment \
--unbuffered \
--version \
--page-faults \
-P \
--progress \
Expand Down Expand Up @@ -64,9 +80,7 @@ _sysdig_complete()
-t \
--timetype \
-c \
--chisel \
-i \
--chisel-info'
--chisel'

local cur=${COMP_WORDS[COMP_CWORD]}
local prev=${COMP_WORDS[COMP_CWORD-1]}
Expand Down
20 changes: 16 additions & 4 deletions scripts/completions/zsh/_sysdig
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,27 @@ _arguments
'(-d --displayflt)'{-d,--displayflt}'[Make the given filter a display one]' \
'(-D --debug)'{-D,--debug}'[Capture events about sysdig itself]' \
'(-E --exclude-users)'{-E,--exclude-users}'[Don'\''t create the user/group tables when starting]' \
'(-e --events)'{-e,--events}'[Rotate the capture file every <num> events]:Maximum event number:' \
'(-e --event-limit)'{-e,--event-limit}'[Rotate the capture file every <num> events]:Maximum event number:' \
'(-F --fatfile)'{-F,--fatfile}'[Enable fatfile mode]' \
'(-G --seconds)'{-G,--seconds=-}'[Rotate the capture file every <num> seconds]:Rotation period (seconds):' \
'(-g --gvisor-config)'{-g,--gvisor-config=-}'[Parse events from gVisor using a config file]:Config file:_files' \
'--gvisor-root=[gVisor root directory]:Root path:_files -/' \
'--gvisor-generate-config=-[Generate a gVisor configuration file]:Socket path:_files' \
'(-h --help)'{-h,--help}'[Print this help]' \
'(-H --plugin)'{-H,--plugin=-}'[Register a plugin with optional init config]:Plugin spec:' \
'(-I --input)'{-I,--input=-}'[Select a plugin as input source]:Plugin input spec:' \
'(-j --json)'{-j,--json}'[Emit output as JSON]' \
'(-k --k8s-api)'{-k,--k8s-api}'[Kubernetes API server]' \
'(-L --list-events)'{-L,--list-events}'[List the events that the engine supports]' \
'(-l -lv --list)'{-l,--list}'[List the fields that can be used for filtering]' \
'(-l -lv --list)-lv[Verbosely list the fields that can be used for filtering]' \
'(-l --list)'{-l,--list}'[List the fields that can be used for filtering]:Field source:' \
'--list-markdown=[List the fields in markdown format]:Field source:' \
'--libs-version[Print the falcosecurity/libs version]' \
'--log-level=[Select log level]:Log level:(trace debug info notice warning error critical fatal)' \
'(-n --numevents)'{-n,--numevents=-}'[Stop capturing after <num> events]:Max <num> events:' \
'--page-faults[Capture user/kernel major/minor page faults]' \
'(-P --progress)'{-P,--progress}'[Print progress on stderr while processing trace files]' \
'(-p --print)'{-p,--print=-}'[Specify the event format (default reported with "sysdig -pp")]:Event output format:->format' \
'--plugin-config-file=[Load plugin configuration from file]:Config file:_files' \
'--plugin-info=[Print info for a single plugin]:Plugin name:' \
'(-q --quiet)'{-q,--quiet}'[Do not print events on the screen]' \
'(-r --read)'{-r,--read=-}'[Read events from <readfile.scap>]:Input file:_files -g "*.scap"' \
'(-R --resolve-ports)'{-R,--resolve-ports}'[Resolve port numbers to names.]' \
Expand All @@ -239,7 +247,11 @@ _arguments
d\:"delta between enter/exit" \
D\:"delta from previous event"))' \
'(-v --verbose)'{-v,--verbose}'[Verbose output]' \
'--color=[Set color mode]:Color mode:(true false force)' \
'--filter-proclist[Apply filter to /proc dump when reading from a file]' \
'--large-environment[Support environments larger than 4KiB]' \
'--unbuffered[Disable buffering of output]' \
'--version[Print version number]' \
'(-w --write)'{-w,--write=-}'[Write events to <writefile.scap>]:Output file:_files -g "*.scap"' \
'(-W --limit)'{-W,--limit}'[Limit split captures (-C, -G or -e) to a given number of files]:Max # of files' \
'(-x --print-hex)'{-x,--print-hex}'[Print data buffers in hex]' \
Expand Down
20 changes: 12 additions & 8 deletions userspace/sysdig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ endif() # NOT WIN32

include(zlib)
include(luajit)
include(cli11)

include_directories("${PROJECT_BINARY_DIR}/userspace/sinspui")
include_directories(../sinspui)
Expand All @@ -36,12 +37,10 @@ if(NOT WIN32)
csysdig.cpp)
else()
set(SOURCE_FILES
sysdig.cpp
win32/getopt.c)
sysdig.cpp)

set(SOURCE_FILES_CSYSDIG
csysdig.cpp
win32/getopt.c)
csysdig.cpp)
endif()

list(APPEND SOURCE_FILES
Expand Down Expand Up @@ -86,6 +85,7 @@ if(USE_BUNDLED_DEPS)
add_dependencies(csysdig yaml-cpp)
add_dependencies(sysdig luajit)
add_dependencies(csysdig luajit)
# CLI11 is header-only, no build dependency needed
endif()

if(USE_BUNDLED_FALCOSECURITY_LIBS)
Expand Down Expand Up @@ -118,7 +118,8 @@ if(NOT WIN32)
target_link_libraries(sysdig
"${SINSP_LIB}"
"${LUAJIT_LIB}"
yaml-cpp)
yaml-cpp
CLI11::CLI11)

if(USE_BUNDLED_NCURSES)
add_dependencies(csysdig ncurses)
Expand All @@ -128,7 +129,8 @@ if(NOT WIN32)
"${SINSP_LIB}"
"${LUAJIT_LIB}"
"${CURSES_LIBRARIES}"
yaml-cpp)
yaml-cpp
CLI11::CLI11)

add_subdirectory(man)

Expand All @@ -150,12 +152,14 @@ else()
target_link_libraries(sysdig
"${SINSP_LIB}"
"${LUAJIT_LIB}"
yaml-cpp)
yaml-cpp
CLI11::CLI11)

target_link_libraries(csysdig
"${SINSP_LIB}"
"${LUAJIT_LIB}"
yaml-cpp)
yaml-cpp
CLI11::CLI11)

target_link_libraries(sysdig odbc32.lib odbccp32.lib Netapi32.lib Iphlpapi.lib)

Expand Down
Loading
Loading