-
Notifications
You must be signed in to change notification settings - Fork 2
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
CLI changes [CPP-585] #378
Conversation
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
struct ConsoleLogPacket<'a> { |
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.
A little annoying we have to use this intermediate struct but i can't figure out a way around it within the logging facade. Switching to &str
avoids some allocations when reading strings back into this struct
// Min one space plus the longest log level | ||
const MIN_SPACES: usize = "CONSOLE".len() + 1; | ||
|
||
let spaces = " ".repeat(MIN_SPACES - packet.level.len()); |
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.
With tabs everything is "jagged", this is kind of a hack but looks nicer? Could go either way on this
I see mentions of Arg Groups here: clap-rs/clap#2621 but it doesn't seem to affect sorting of the help blurb, still would be good for some of our grouped commands. I think for ordering we may be forced to hardcode the help blurb which is kind of a shame. I think we can push that off closer to launch if we happen to add/change any other CLI args until then. |
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.
rebase then
There is also a way to manually specify the ordering (or make it follow the struct def), but can't figure out how to get the help flags in the right place |
c13493c
to
40068db
Compare
Maybe this |
This is what it looks like now
Ticket didn't mention |
#[derive(Parser)] | ||
#[clap( | ||
name = "swift_navigation_console", | ||
about = "Swift Navigation Console.", | ||
version = include_str!("version.txt") | ||
bin_name = BIN_NAME, |
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.
This fixes the name locally, not sure if that was still and issue with dists?
No description provided.