Commit Graph

51 Commits

Author SHA1 Message Date
Wolfgang Bumiller
cc84a830c5 RFC: schema: make enums static
I don't see a reason to allow these to be dynamically
modifiable.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-05-23 12:38:51 +02:00
Wolfgang Bumiller
062d4916ff api_schema: allow generic api handler functions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-16 11:22:23 +02:00
Christian Ebner
e04d1bfadc Cleanup of if statement with unwraps by a more compact match statement
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-03-20 09:49:18 +01:00
Dietmar Maurer
9e26abf16b src/cli/command.rs: fix iterator usage 2019-03-15 07:12:40 +01:00
Dietmar Maurer
1a71509aad src/cli/command.rs: fix completion - never display argument parameters as option 2019-03-12 14:53:41 +01:00
Dietmar Maurer
496a67846f src/cli/command.rs: pass parsed parameters to completion function 2019-03-12 14:39:51 +01:00
Dietmar Maurer
b5fa28251c src/cli/getopts.rs: factor out reusable code 2019-03-12 14:38:47 +01:00
Dietmar Maurer
e39efdbd33 src/cli/command.rs: use a HashMap to store fixed param as key/value pairs 2019-03-12 12:54:16 +01:00
Dietmar Maurer
f4e4d58327 src/cli/command.rs: improve completions 2019-03-12 12:07:45 +01:00
Dietmar Maurer
25e77d3877 src/cli/command.rs: print_bash_completion - avoid crash 2019-03-07 12:14:26 +01:00
Dietmar Maurer
b55cee9227 src/cli/command.rs: generate_usage_str() - fix option separator (newline) 2019-02-28 16:20:00 +01:00
Dietmar Maurer
c4c5174000 src/cli/command.rs: get_schema_type_text() - display min/max 2019-02-28 16:11:49 +01:00
Dietmar Maurer
9bc3ddb822 src/cli/command.rs: improve generate_usage_str
correctly format positional array arguments ({<name>}).
2019-02-26 12:40:51 +01:00
Dietmar Maurer
d02c2ed701 src/cli/getopts.rs: cleanup, avoid compiler warning 2019-02-26 11:55:06 +01:00
Dietmar Maurer
aaba6faace src/cli/getopts.rs: support positional array arguments 2019-02-26 08:47:34 +01:00
Dietmar Maurer
f33fa27307 src/cli/command.rs: improve error message 2019-02-26 08:46:36 +01:00
Dietmar Maurer
793b0f4d77 src/cli/command.rs: improve help command completion 2019-02-23 18:07:32 +01:00
Dietmar Maurer
6949d91564 src/cli/command.rs: cleanup, avoid array manipulation 2019-02-23 17:50:33 +01:00
Dietmar Maurer
9d78d57960 src/cli/command.rs: implement bash completion for help 2019-02-23 17:38:10 +01:00
Dietmar Maurer
698d9d4402 src/cli/command.rs: add help command 2019-02-23 15:10:48 +01:00
Dietmar Maurer
8b6dd2240d src/cli/command.rs::allow to generate ReST docu 2019-02-23 11:29:18 +01:00
Dietmar Maurer
2f3f2bb77f src/cli/command.rs: improve usage imformation 2019-02-22 17:40:37 +01:00
Dietmar Maurer
6adb40eefc src/cli/command.rs: start implementing generate_usage_str() 2019-02-22 12:02:59 +01:00
Dietmar Maurer
33256db6dd src/cli/command.rs: simplify cli handler 2019-02-22 11:15:10 +01:00
Dietmar Maurer
532a69eb04 src/cli/getopts.rs: improve docs 2019-02-21 09:36:52 +01:00
Dietmar Maurer
4de0e142a0 cleanup cli library structure 2019-02-21 09:08:03 +01:00
Dietmar Maurer
ef2f2efbcc improve api_schema module structure 2019-02-17 10:16:33 +01:00
Dietmar Maurer
dc9a007b11 rename src/api to src/api_schema 2019-02-17 09:59:20 +01:00
Dietmar Maurer
d7d23785f0 RpcEnvironment: implement set_user() and get_user() 2019-01-27 10:52:26 +01:00
Dietmar Maurer
162b979394 RpcEnvironment: add environment type enum RpcEnvironmentType 2019-01-27 10:33:42 +01:00
Dietmar Maurer
0f253593c6 move rpc environment implementation to separate files 2019-01-26 15:08:02 +01:00
Dietmar Maurer
6049b71f41 api: pass RpcEnvirnment to api handlers 2019-01-26 14:50:37 +01:00
Dietmar Maurer
379ea0edb6 Revert "/api/schema.rs: implement Schema::Option"
This reverts commit 0a35462c1e.

I am not sure this add much value, and the old approach needs
less memory. If we really need single optional values, we can still
implement such Option while keeping the hash based approach...
2019-01-19 12:53:32 +01:00
Dietmar Maurer
0a35462c1e /api/schema.rs: implement Schema::Option 2019-01-18 17:40:37 +01:00
Dietmar Maurer
244d9b17a8 bin/proxmox-backup-client.rs: implement file name completions - first try ... 2019-01-17 14:24:20 +01:00
Wolfgang Bumiller
4968bc3ac0 cli::command: wrap usage errors in a UsageError
So we can distinguish them and show usage output
conditionally.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-03 16:08:51 +01:00
Dietmar Maurer
a27a3ee4ba avoid compiler warnings 2018-12-16 13:57:59 +01:00
Dietmar Maurer
7f4e639b37 improve completion 2018-12-12 13:00:58 +01:00
Dietmar Maurer
30d2e99c77 implement completion functions 2018-12-12 12:19:26 +01:00
Dietmar Maurer
ca9caffa23 cleanup parameter types 2018-12-12 10:37:03 +01:00
Dietmar Maurer
38555b5072 implement completion for enums 2018-12-12 08:33:50 +01:00
Dietmar Maurer
2f0258959b improve completion 2018-12-12 08:18:38 +01:00
Dietmar Maurer
f46403cc65 improve bash completion 2018-12-12 07:51:43 +01:00
Dietmar Maurer
b6e8dd39aa impl bash completion: first try 2018-12-11 14:21:05 +01:00
Dietmar Maurer
c21de379ed install bash completion scripts
Completion itself is not implemented.
2018-12-11 12:54:10 +01:00
Dietmar Maurer
6460764dbb cli/command.rs: add new type CliCommandMap 2018-12-11 11:31:36 +01:00
Dietmar Maurer
bf7f103944 implement builder pattern for CliCommand 2018-12-11 11:12:13 +01:00
Dietmar Maurer
baed30b702 cli/command.rs: implement prefix match 2018-12-10 18:13:55 +01:00
Dietmar Maurer
8f62336b0f impl From for CommandLineInterface 2018-12-10 13:51:10 +01:00
Dietmar Maurer
9f6ab1fc58 rename CmdDef to CommandLineInterface 2018-12-10 13:40:10 +01:00