-
-
Notifications
You must be signed in to change notification settings - Fork 1
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/env headers #50
Feat/env headers #50
Conversation
GabrielBrandao1618
commented
May 19, 2024
- Add headers field to env
- Add set header command
- Add list headers command as well(still not configured though)
src/cli.rs
Outdated
#[derive(Debug, Subcommand)] | ||
pub enum HeaderEnvCmd { | ||
Set { headers: Vec<String> }, | ||
Ls, | ||
Rm(action::env::HeaderRmArgs), | ||
Get(action::env::HeaderGetArgs), |
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.
Could we use the same Cmd struct as for endpoint's Header? That would be useful to preserve documentation and the same usage.
The same is true for the Headers
struct. Having 2 distinct implementations (endpoint::Headers
and env::Headers
) is kinda confusing, as they should both implement the same functionality.
This also avoids us needing to reimplementing all the traits.
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.
Yeah, that makes sense!
src/action/ls.rs
Outdated
@@ -156,6 +156,7 @@ pub fn cmd(ctx: &Ctx, args: Args) { | |||
} | |||
|
|||
for child in node.children.iter() { | |||
println!("This is a child: {}", child.value.handle()); |
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.
println!("This is a child: {}", child.value.handle()); |
In code, that is a great implementation now! However, I noticed a tiny bug that at one point was a problem with some other commands. @GabrielBrandao1618, could you fix that before we merge? |
By the way, that probably happens because |
@EduardoRodriguesF done! |