summaryrefslogtreecommitdiffstats
path: root/commands/global.c
Commit message (Collapse)AuthorAgeFilesLines
* commands: global: document usage without parametersRoland Hieber2023-08-181-1/+2
| | | | | | Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20230814141112.567070-1-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: implement and use parse_assignment helperAhmad Fatoum2020-11-271-5/+1
| | | | | | | | | | | | We have the split by '=' snippet at multiple locations that parse key=value pairs. Consolidate them to a single location. This makes code a bit easier to read at the cost of an extra 8 bytes (LZO-compressed THUMB2 barebox, static inline version is bigger). No functional change. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/*: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-04-271-18/+5
| | | | | | | | | | | | | While at it also drop references to the non-existing CREDITS file and do some small rearrangements for some uniform formatting. (SPDX-License-Identifier first, then copyright texts and then an empty line.) The advantage is that these specifiers are machine-parseable which helps license conformance. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nv: add device parameter overwrites to completion listSascha Hauer2017-11-231-1/+1
| | | | | | | | nv variables in the form dev.<devname>.* can be used to make device parameters persistent. Add these to the completion list to make setting these variables more convenient. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* complete: Add completion for nv and globalvar commandsSascha Hauer2016-10-181-0/+2
| | | | | | | | The 'nv' command is often used to create a nv variable for an existing global variable, so add a command completion function for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* global: Make 'global' command behaviour consistent to 'nv'Sascha Hauer2016-09-221-18/+17
| | | | | | | | | | | | The 'nv' command can add/remove multiple variables. Implement that for the 'global' command aswell. Also with the 'nv' command the -r option is for removal of variables, not for "set match". Looking at the users of "global -r" the only user uses the command for removal of variables and not for "Setting multiple variables to the same value" as stated in the command help text. Let "global -r" remove variables aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: Add support for printing all global variablesSascha Hauer2014-11-061-0/+5
| | | | | | | | | This could previously only be done with 'devinfo global'. While this is still possible this adds a more direct access via the globalvar command. This variant also adds a '*' in front of the variable if the corresponding non volatile variable exists. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: Allow to set initial valueSascha Hauer2013-08-161-16/+1
| | | | | | | Calling globalvar_add_simple() and setting a value is more than common. Add a parameter for the initial value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-3/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | globalvar: add support to set a value to of all globalvars beginning with ↵Jean-Christophe PLAGNIOL-VILLARD2012-09-141-11/+40
|/ | | | | | | | 'match' via c global_set_match and global -r Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* add 'global' commandSascha Hauer2012-05-141-0/+62
This implements global shell variable support. This is done by registering a new device named 'global', so global variables are just plain device parameters. Global variables are useful for storing the global state in the environment. Currently we do this by sourcing scripts instead of executing them which is quite limiting. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>