Tobias Brunner
a1ad9e39fc
pki: Make sure options array passed to getopt_long() ends with a NULL entry
2026-05-19 17:27:33 +02:00
Tobias Brunner
d5e95342b5
swanctl: Check for conflicts with existing and shared options when registering commands
2026-02-23 11:25:00 +01:00
Tobias Brunner
be68bd50b7
pki: Add global --debug and --options arguments
...
This allows setting the log level before initializing the library and
loading the plugins, as well as having the top-level command itself in
an options file.
2026-02-06 11:21:34 +01:00
Tobias Brunner
37ec770758
pki: Reduce indentation in usage output and print command description
...
Also print error message at the end of the output.
2025-05-27 17:38:32 +02:00
Tobias Brunner
a7b5de5690
pki: Fix signature of help() to match that of a callback in command_t
2025-03-19 10:22:37 +01:00
Tobias Brunner
5764e1e506
pki: Pre-process common arguments
...
This way the position of --debug doesn't matter for it to apply to the
parsing of all command-specific arguments.
2023-11-13 12:50:47 +01:00
Tobias Brunner
19ef2aec15
Update copyright headers after acquisition by secunet
2022-06-28 10:22:56 +02:00
Tobias Brunner
ea1f4cd7a9
pki: Avoid naming conflict with global variables for passed arguments
2020-01-28 15:32:43 +01:00
Tobias Brunner
1b67166921
Unify format of HSR copyright statements
2018-05-23 16:32:53 +02:00
Tobias Brunner
9b828ee85f
pki: Indent usage lines properly automatically
2017-11-08 16:48:10 +01:00
Tobias Brunner
8ea64a78d6
pki: Never print more than MAX_LINES of usage summary
...
Print a warning if a registered command exceeds that limit.
2015-12-16 12:07:13 +01:00
Tobias Brunner
bb91109af8
pki: Also check for MAX_COMMANDS when building getopt_long arguments
...
Completes 87e53819a6 and 0a8c399a21 .
2014-06-24 15:11:27 +02:00
Martin Willi
0a8c399a21
pki: When dispatching commands, don't look beyond non-null-terminated array
2014-03-19 09:37:46 +01:00
Martin Willi
87e53819a6
pki: Check length of commands array before accessing command in --help
...
As --help is counted as command as well, the array is not null-terminated
and we have to check for MAX_COMMANDS.
Fixes #550 .
2014-03-19 09:25:29 +01:00
Martin Willi
1c667bce3f
pki: Make cmds array static, ensuring that it is zero-initialized
...
As pki --help relies on a zero-terminated array, make the actually non-public
cmds array static to ensure initialization.
2014-02-20 11:45:51 +01:00
Tobias Brunner
040cf911a6
pki: Make sure no command registers too many options
2014-01-23 10:12:24 +01:00
Tobias Brunner
2b8224fce3
pki: Print a warning if MAX_COMMANDS is too low
2014-01-23 10:10:53 +01:00
Tobias Brunner
b0e14fcba6
pki: Properly use ?: when defining option arrays
2014-01-23 10:10:53 +01:00
Tobias Brunner
ed56c86ec1
pki: Don't print an error if no arguments are given
2013-09-13 15:14:00 +02:00
Tobias Brunner
f05b427265
Moved debug.[ch] to utils folder
2012-10-24 16:00:51 +02:00
Tobias Brunner
8b0dce08f2
Avoid overrunning array when registering pki command line options
2012-09-28 18:22:54 +02:00
Tobias Brunner
f1ba06c1c6
Cache list of plugin names to further simplify its usage.
...
Also helpful for ipsec statusall to avoid having to enumerate plugins.
2012-01-19 12:37:42 +01:00
Tobias Brunner
fdf1f239ef
Log list of loaded plugins in main PKI help output.
2012-01-19 11:56:43 +01:00
Martin Willi
a864eb37b1
Added policyConstraints support to pki tool
2011-01-05 16:46:02 +01:00
Martin Willi
e6fbe5933b
pki --issue/self support permitted/excluded NameConstraints
2011-01-05 16:46:00 +01:00
Martin Willi
0c73ceff0a
Added a --signcrl command to the pki utility
2010-05-21 16:25:51 +02:00
Martin Willi
17859fe6cf
Right-align short options in pki usage
2009-09-24 11:28:53 +02:00
Martin Willi
b538b606da
Use the default debug hook if possible
2009-09-16 13:16:00 +02:00
Martin Willi
ae7452e87c
Handle pki --debug and --options in a generic way for all command
2009-09-15 11:53:46 +02:00
Martin Willi
4fdb9f6f74
pki tool supports single letter short options
2009-09-15 10:20:22 +02:00
Martin Willi
3ce9438b60
Use dynamic registration/usage invocation of command types
2009-09-10 16:18:30 +02:00
Martin Willi
6be68cc1c7
splitted PKI tool to a file per command
2009-09-10 12:31:40 +02:00