Skip to content

Commit

Permalink
Add raw request output (issue #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh1Yo committed Aug 11, 2021
1 parent bfe5f42 commit 2820901
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ OPTIONS:
Available: GET, POST, PUT, PATCH, DELETE, HEAD. (default is "GET")
-o, --output <file>
-O, --output-format <output-format> standart, json, url (default is "standart")
-O, --output-format <output-format> standart, json, url, request (default is "standart")
-P, --param-template <parameter_template>
%k - key, %v - value. Example: --param-template 'user[%k]=%v&'
Expand Down
2 changes: 1 addition & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn get_config() -> (Config, usize) {
Arg::with_name("output-format")
.short("O")
.long("output-format")
.help("standart, json, url (default is \"standart\")")
.help("standart, json, url, request (default is \"standart\")")
.takes_value(true)
)
.arg(
Expand Down
3 changes: 3 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ pub fn create_output(config: &Config, found_params: Vec<String>) -> String {

line
},
"request" => {
generate_request(config, &make_hashmap(&found_params, config.value_size))
},
_ => {
let mut line = format!("{} {} % ", &config.method, &config.initial_url);

Expand Down

0 comments on commit 2820901

Please sign in to comment.