Commit Graph

68 Commits

Author SHA1 Message Date
Johannes Meyer 2e5abbc832 Use ipl-i18n's `Translation` trait where applicable 2021-05-28 14:03:36 +02:00
Johannes Meyer 629a39ebbe Cli/Loader: Configure the used `Screen` to use STDERR
Otherwise we still colorize output if stderr is being
redirected.
2020-11-30 15:35:20 +01:00
Alexander A. Klimov d7e3547c6e CLI: write errors to stderr 2020-11-30 15:35:20 +01:00
Eric Lippmann 98b8631db3 Optimize imports 2019-07-12 14:23:41 +02:00
Eric Lippmann 6fa5af4de1 CLI: Automatically load enabled modules if not disabled 2019-07-12 14:23:41 +02:00
Niko Martini 7abd1b906b Cli: add version command
refs #3763
2019-07-11 08:17:56 +02:00
Johannes Meyer 5d9aa0895f
Merge pull request #3570 from MVKozlov/patch-1
Return non-zero on display usage
2019-05-22 12:21:46 +02:00
Max Kozlov 27d12163c4 Icingacli should return UNKNOWN code, showUsage() also should return non-zero 2019-05-21 09:48:38 +03:00
Johannes Meyer eb7db67dee
Merge pull request #3578 from Icinga/fix/cli-command
Fix uninitialized array and module in Cli\Command
2019-04-26 15:55:45 +02:00
Johannes Meyer 498f37d4ff
Command: Function getMainConfig should not deliver module config
Co-Authored-By: mxhash <mxhash@users.noreply.github.com>
2019-04-26 14:37:06 +02:00
Thomas Gelf a487f83f99 Loader: fix indentation...
...it's too early in the morning, wrong .vimrc on this system - sorry.
2019-02-20 05:48:04 +01:00
Thomas Gelf 7868216d04 Loader: close clicommands directory after use
fixes #3688
2019-02-20 05:36:08 +01:00
Marius Hein ae469311be Fix uninitialized array and module in Cli\Command 2018-09-24 13:48:22 +02:00
Alexander A. Klimov b79c140c43 Correct CLI help text for modules
refs #2801
2017-05-30 17:55:52 +02:00
Johannes Meyer 181e2ef05c Swag: Fix swag (aka a whole bunch of code style issues..) 2017-01-27 14:48:59 +01:00
Alexander A. Klimov 1aada1abbb Present the fact that Icinga Web 2's config directory isn't readable in a nicer way
fixes #11119
2016-02-25 17:31:09 +01:00
Alexander A. Klimov 9c592ead23 icingacli: repair command and action shortcuts
refs #11120
2016-02-10 13:28:34 +01:00
Alexander A. Klimov 474803fee4 Change all license headers to only reflect a file's year of creation
refs #11000
2016-02-08 15:41:00 +01:00
Johannes Meyer 424557f194 StdoutWriter: Rename to StderrWriter 2016-01-21 11:47:11 +01:00
Johannes Meyer 9240d1b4e0 cli: Polish log handling
* Reintroduced Command::$isDebugging, now without typo
* Removed @deprecated from Command::$isVerbose
* Changed default log level to WARNING
* Adjusted --verbose and --debug to activate log level INFO and DEBUG, respectively
2016-01-21 11:29:28 +01:00
Johannes Meyer 37dc601505 Command: Remove property "isDebugging"
It's not used anywhere and wrong initalized anyway.
2016-01-19 15:08:20 +01:00
Johannes Meyer be239b9a22 Cli: Configure logging properly but also offer customisations 2016-01-19 15:07:17 +01:00
Thomas Gelf 94690f4fda Cli\Screen: fix tput for rows (it's lines) 2015-11-16 18:50:48 +01:00
Alexander A. Klimov 327cf37326 Command: make $config and $configs protected 2015-11-03 16:11:20 +01:00
Alexander A. Klimov e170d5b79a Command::fail(): construct IcingaException printf-like
The first argument of IcingaException::__construct() must be a printf-like format string, but Command::fail() must accept any message string.
2015-11-03 10:45:39 +01:00
Matthias Jentsch 2d9d3a0788 Detect exact names during autocompletion
Do not recognize substrings of strings as the full string in searchMatch.

fixes #9633
2015-08-21 13:48:11 +02:00
Johannes Meyer 982e226db0 IcingaException: Add utility method to format exceptions as one-liner 2015-07-24 16:19:20 +02:00
Johannes Meyer c1a3d205bc Show more details about unhandled exceptions in the CLI
fixes #9646
2015-07-24 15:58:32 +02:00
Alexander A. Klimov 392047b2ee Add support for command line arguments in the format --arg=<value>
refs #8472
2015-06-10 17:19:49 +02:00
Eric Lippmann 338fad5da9 cli: Add Params::shiftRequired() 2015-05-20 10:30:00 +02:00
Eric Lippmann ccaebd1d73 cli: Rename Params::req() to ::getRequired() 2015-05-20 10:30:00 +02:00
Alexander Klimov 967a2e82dc Use (only) "@return $this" in fluent interfaces' documentation 2015-04-07 14:24:11 +02:00
Eric Lippmann 002e793a53 lib: Add Params::req()
Params::req() should be used for requiring a mandatory CLI parameter.

refs #8886
2015-04-07 12:20:37 +02:00
Eric Lippmann 8563d5ed3f PHPDoc: Use @var instead of @type
Becasue of too many kittens PSR-5 backed off of deprecating @var.
So that's the way we go too.
2015-03-12 16:08:47 +01:00
Eric Lippmann 6bae2e0a53 Note that our license is GPL v2 or any later version in our license header instead of pointing to the license's URL 2015-02-04 10:52:27 +01:00
Eric Lippmann 5b4fab0750 Add license header
This time without syntax errors hopefully :)
2015-02-03 16:27:59 +01:00
Eric Lippmann 5fa2e3cfdc Revert "Add license header"
This reverts commit 338d067aba.
2015-02-03 16:16:26 +01:00
Eric Lippmann 338d067aba Add license header
fixes #7788
2015-02-03 15:51:04 +01:00
Eric Lippmann 70c564bb0e Cli: Remove useless sprintf format in Command::fail() 2014-12-30 14:41:00 +01:00
Eric Lippmann 8eb37d9d76 Cli/Command: Add @type PHPDoc to params 2014-12-30 14:33:36 +01:00
Eric Lippmann ce69300c9a cli: Fix the path to the clicommands 2014-11-14 16:01:40 +01:00
Eric Lippmann bfa834fc3b Remove constant ICINGAWEB_APPDIR
We should avoid use of constants.
2014-11-13 09:33:31 +01:00
Eric Lippmann fa9bd59565 lib: Support `isset()' and `empty()' checks on CLI params 2014-10-01 08:17:35 +02:00
Alexander Klimov 45638b218c Throw IcingaException rather than Exception
fixes #7014
2014-08-27 16:03:15 +02:00
Alexander Klimov febb2d1ae2 ProgrammingError: extend IcingaException
refs #6931
2014-08-26 11:15:19 +02:00
Thomas Gelf a38d71f17c Cli\Command: provide Config()
This makes it feel more like action controllers

fixes #6954
2014-08-19 10:27:26 +02:00
Johannes Meyer 3105c2059e Remove license headers from all files
refs #6309
2014-07-15 13:43:52 +02:00
Johannes Meyer 561616dca0 Add support for multi-value options
Makes it possible to supply options multiple times and to supply the
"--" flag to indicate that there are no options anymore to parse

refs #6092
2014-06-13 09:58:50 +02:00
Johannes Meyer 851977cbeb Revert "Add clicommands to run unit- and style-tests"
This reverts commit 0805d73e34.
2014-06-13 09:14:22 +02:00
Johannes Meyer 0805d73e34 Add clicommands to run unit- and style-tests
refs #6092
2014-06-12 16:29:07 +02:00