Commit Graph

29 Commits

Author SHA1 Message Date
Emmanuel Kasper
a4f181a37e Use double hyphens when prefixing command options in the documentation
This makes our man pages follow the GNU long option recommandations
where non-single character options are prefixed with a double hyphen
(https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html)

The benefit for PVE is that our documentation looks more similar to what
a user with previous Linux knowledge is used to.

Our bash autocompletion helper only completes options using double hyphens too.
2017-09-12 12:18:50 +02:00
Fabian Grünbichler
77096a6fa4 rename variable
to prevent confusion of rendered type text vs. original type
property

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-01 13:45:41 +02:00
Fabian Grünbichler
fbb0ec640a api: fix rendering of filepath/string parameters
25d9bda941 broke this check,
but it is a better idea to check against the actual type
rather then the rendered type text anyway.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-01 13:45:41 +02:00
Dietmar Maurer
4612730446 RESTHandler.pm: remove register_page_formatter (no longer required) 2017-01-18 13:13:23 +01:00
Dietmar Maurer
abc1afd874 schema_get_type_text: do not always expand enums
We try to keep the text short by default.
2016-11-05 16:44:59 +01:00
Dietmar Maurer
25d9bda941 schema_get_type_text: render generic types as <type> 2016-11-05 15:38:29 +01:00
Dietmar Maurer
b54ad320a5 fix doc generator (do not convert efidisk0 to efidisk[N])
Also fix spacing in typetext generator.
2016-09-29 12:15:47 +02:00
Dietmar Maurer
534d427098 add typetext property for more complex types 2016-09-05 07:47:32 +02:00
Dietmar Maurer
32f8e0c75b improve doc generator, introduce verbose_description property 2016-05-19 13:11:26 +02:00
Dietmar Maurer
bf27456b4e remove PodParser.pm, implement keyAlias feature
The keyAlias feature replaces the previous 'group_ feature.
2016-05-11 10:02:34 +02:00
Dietmar Maurer
b546f33e58 fix coding style 2016-04-19 12:39:04 +02:00
Fabian Grünbichler
f922b8a8be Fix indexed parameter conversion in documentation
this would previously convert properties that matched
'^([a-z]+)(\d+)$' even if they were not part of an indexed
properties series (which always start with 0).

This fixes previously wrongly converted properties:
-smbios1
-server2
2016-04-19 12:29:31 +02:00
Fabian Grünbichler
2c2a5fd3df Fix indexed parameter conversion in API dump
this would previously skip (i.e., ignore) properties that
matched '^([a-z]+)(\d+)$' even if they were not part of an
indexed properties series (which always start with 0).

This fixes previously missing API dump occurrences of:
-smbios1
-comments6
-netmask6
-gateway6
-address6
-dns1
-dns2
-dns3
-server1
-server2
2016-04-19 12:26:26 +02:00
Dietmar Maurer
b0e5e9fa0c another fix for $get_property_description() - remove format 'pod'
Instead, use the same enum as in usage_str().
2016-04-07 17:30:52 +02:00
Dietmar Maurer
305068a7e5 pass correct format to $get_property_description() 2016-04-07 07:52:35 +02:00
Fabian Grünbichler
6577ea458f Fix uninitialized subroutine error 2016-04-05 15:22:27 +02:00
Fabian Grünbichler
4845032a46 Replace 'string' with 'filepath' for mapped params
For the CLI man pages and documentation, mapped parameters
('content' strings in API2 which are loaded from file paths
in CLI) get special treatment and are displayed with the
type 'filepath'.
2016-04-05 12:22:46 +02:00
Fabian Grünbichler
408976c6f7 Handle string parameter to file content replacement
This is modelled after the way read_password() is used to
wrap -password parameters on the command line. If a mapping
for a certain API method and parameter is defined in the
sub class of CLIHandler.pm, the parameter is interpreted as
a file path on the command line and the parameter is
filled with the string contents of the referenced file.

This allows us to use the same API schema once in API2, but
overwrite the behaviour for individual parameters in the CLI
tools when desired.
2016-04-05 12:22:38 +02:00
Dietmar Maurer
df79b4284d get_property_description: introduce new $style parameter
config => colon separated config files
arg => command line argument
fixed => fixed command line argument (see usage_str())
2016-03-31 05:57:37 +02:00
Dietmar Maurer
a736ac996c get_property_description: add new 'text' format 2016-03-23 10:19:15 +01:00
Dietmar Maurer
921f91d1d5 get_property_description: use correct base name opt[n] 2016-03-23 09:27:18 +01:00
Dietmar Maurer
8fa050cd62 new PVE::RESTHandler::dump_properties
The plan is to replace code in PodParser.
2016-03-23 06:58:10 +01:00
Dietmar Maurer
7a83df1bc9 improve asciidoc markup 2015-12-29 18:43:12 +01:00
Dietmar Maurer
fe3f1fdef1 add experimental 'asciidoc' generator
useful to generate manual pages using asciidoc.
2015-12-29 17:02:00 +01:00
Dietmar Maurer
4be9b5f7de api_clone_schema: use Clone::clone instead of Storable::dclone
This works with CODE refs like 'completion' helpers.
2015-10-07 08:55:42 +02:00
Wolfgang Bumiller
5851be88ad added 'extra-args' CLI handling
added 'extra-args' standard option
added 'extra-args' handling to PVE::JSONSchema::get_options
untainting 'extra-args' separately in RESTHandler::handle
2015-09-01 17:46:04 +02:00
Alen Grizonic
9030a7d7f6 validate error message (typo) corrected
Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
2015-07-22 08:16:22 +02:00
Wolfgang Bumiller
a1609259d3 remove superfluous substitution
regexps are greedy so the first substitution eats up
multiple groups of double-colons up to the last one already.
So unless there's some intended hidden side effect this
statement has no obvious purpose.
2015-06-05 15:33:58 +02:00
Dietmar Maurer
b51b16e6f5 rename data to src 2015-02-27 16:57:20 +01:00