Skip to content

Commit 35a9a6b

Browse files
committedMar 25, 2025·
src/dec/main.c -> src/dec.c, rename cli utility to 'ptp', add install command
1 parent f50593b commit 35a9a6b

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed
 

‎CMakeLists.txt

+7-3
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ if(PTP_INCLUDE_CLI)
7474
find_package(PkgConfig REQUIRED)
7575
pkg_check_modules(LIBPCAP REQUIRED libpcap)
7676

77-
add_executable(pict
77+
add_executable(ptp
7878
src/cli.c
7979
src/dec/main.c
8080
)
81-
target_include_directories(pict PUBLIC ${PROJECT_SOURCE_DIR}/src ${LIBPCAP_INCLUDE_DIRS})
82-
target_link_libraries(pict libpict ${LIBUSB_LIBRARIES} ${LIBPCAP_LIBRARIES})
81+
target_include_directories(ptp PUBLIC ${PROJECT_SOURCE_DIR}/src ${LIBPCAP_INCLUDE_DIRS})
82+
target_link_libraries(ptp libpict ${LIBUSB_LIBRARIES} ${LIBPCAP_LIBRARIES})
83+
84+
install(
85+
TARGETS ptp
86+
)
8387
endif()
8488

8589
macro(add_example exe_name source)

‎src/cli.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ struct Options {
1212

1313
static int usage(void) {
1414
printf(
15-
"pict\n"
16-
" --dec <input_file> <output_file> Decode any PTP/USB packet dump into a readable text file\n"
15+
" --dec <input_file> <output_file> <mode>\n"
16+
" Decode any PTP/USB packet dump into a readable text file\n"
17+
" Valid values for <mode>:\n"
18+
" usb Decode pcap USB/ethernet packets\n"
19+
" wifi Decode pcap TCP packets\n"
1720
" --help\n"
1821
" --run <operation> <args>\n"
19-
" --dont-open-session (A session is opened/closed by default)\n"
22+
" Invoke the binding API\n"
23+
" --dont-open-session\n"
24+
" (A session is opened/closed by default)\n"
25+
"Examples:\n"
2026
" --run ptp_hello_world 1 2 3 \"Hello, World\"\n"
2127
);
2228
printf("Compile date: " __DATE__ "\n");

‎src/dec/main.c ‎src/dec.c

File renamed without changes.

‎src/dec/Makefile

-2
This file was deleted.

‎src/dec/README.md

-6
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.