-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: Improve command line argument handling #56
base: main
Are you sure you want to change the base?
Changes from all commits
ba2977a
3c5e18b
ff98aaf
3611eaa
a686188
e80ffa8
8bddb5e
bc894a8
1d6ee5c
52d0503
6b75974
b2b315d
9d3ec38
a365d7b
df31fe2
f113c29
fd2e90d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,64 @@ | ||||||||||||||
#ifndef SPIDER_UTILS_PROGRAMOPTIONS_HPP | ||||||||||||||
#define SPIDER_UTILS_PROGRAMOPTIONS_HPP | ||||||||||||||
|
||||||||||||||
#include <string_view> | ||||||||||||||
|
||||||||||||||
namespace spider::core { | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cSchedulerUsage | ||||||||||||||
= {"Usage: spider_scheduler --host <host> --port <port> --storage-url <url>"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cSchedulerHelpMessage | ||||||||||||||
= {"Try 'spider_scheduler --help' for detailed usage instructions.\n"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cWorkerUsage | ||||||||||||||
= {"Usage: spider_worker --host <host> --storage-url <storage_url> --libs <libs>"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cWorkerHelpMessage | ||||||||||||||
= {"Try 'spider_worker --help' for detailed usage instructions.\n"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cTaskExecutorUsage | ||||||||||||||
= {"Usage: spider_task_executor --func <function> --task-id <task_id> --storage-url " | ||||||||||||||
"<storage_url> --libs <libs>"}; | ||||||||||||||
Comment on lines
+20
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix inconsistent argument naming in task executor usage message. The option Apply this diff to fix the inconsistency: - = {"Usage: spider_task_executor --func <function> --task-id <task_id> --storage-url "
+ = {"Usage: spider_task_executor --func <function> --task-id <task-id> --storage-url " 📝 Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
constexpr std::string_view cTaskExecutorHelpMessage | ||||||||||||||
= {"Try 'spider_task_executor --help' for detailed usage instructions.\n"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cHelpOption = {"help"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cHelpMessage = {"Print this help text."}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cHostOption = {"host"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cHostMessage = {"The host address to bind to"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cHostEmptyMessage = {"The host address should not be empty"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cPortOption = {"port"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cPortMessage = {"The port to listen on"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cStorageUrlOption = {"storage-url"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cStorageUrlMessage = {"The storage server's URL"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cStorageUrlEmptyMessage | ||||||||||||||
= {"The storage server's URL should not be empty"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cLibsOption = {"libs"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cLibsMessage = {"The tasks libraries to load"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cLibsEmptyMessage = {"The tasks libraries should not be empty"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cFunctionOption = {"func"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cFunctionMessage = {"The function to execute"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cTaskIdOption = {"task-id"}; | ||||||||||||||
|
||||||||||||||
constexpr std::string_view cTaskIdMessage = {"The id of the task to execute"}; | ||||||||||||||
|
||||||||||||||
} // namespace spider::core | ||||||||||||||
|
||||||||||||||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix inconsistent argument naming in worker usage message.
The usage message shows
storage_url
with an underscore, but the actual option is defined with a hyphen asstorage-url
. This inconsistency could confuse users.Apply this diff to fix the inconsistency:
📝 Committable suggestion