nobodd.sh
This module contains the implementation (and entry point) of the nobodd-sh application.
Application functions
- nobodd.sh.main(args=None)[source]
The main entry point for the nobodd-sh application. Takes args, the sequence of command line arguments to parse. Returns the exit code of the application (0 for a normal exit, non-zero for an error).
If
DEBUG=1is found in the application’s environment, top-level exceptions will be printed with a full back-trace.DEBUG=2will launch PDB in post-mortem mode.
- nobodd.sh.get_parser()[source]
Returns the command line parser for the application, pre-configured with defaults from the application’s configuration file(s). See
ConfigArgumentParser()for more information.
- nobodd.sh.get_paths(inputs, outputs, *, allow_std=False)[source]
Given inputs and outputs, two iterables of filenames (or paths), which may include image prefixes (e.g.
test.img:1/filename), returns adictmapping each filename to aPathorFatPathinstance.
- nobodd.sh.same_fs(path1, path2)[source]
Test whether path1 and path2 (both either
PathorFatPathinstances) are part of the same file-system.Note that this does not mean part of the same mount in the Linux file-system. This returns
Trueif both paths arePathinstances, or if both paths areFatPathinstances and both belong to the sameFatFileSysteminstance.
Command implementations
- nobodd.sh.do_cat(config)[source]
Concatenate content from the given files, writing it to stdout by default. If - is given as a filename, or if no filenames are specified, stdin is read. In order to permit output to a file within an image, -o is provided to specify an output other than stdout.
- nobodd.sh.do_cp(config)[source]
Copy the specified file over the target file, if only one source is given, or copy the specified files and directories into the target directory, if the target is a directory.
- nobodd.sh.do_help(config)[source]
With no arguments, displays a list of %(prog)s commands. If a command name is given, displays the description and options for the named command.
- nobodd.sh.do_ls(config)[source]
List information about the files, or the contents of the directories given. Entries will be sorted alphabetically, unless another ordering is explicitly specified. By default, hidden files (beginning with “.”) are excluded from the output, unless -a is provided.
- nobodd.sh.do_mkdir(config)[source]
Creates the directories specified, which must not exist either as directories or regular files.
- nobodd.sh.do_mv(config)[source]
Move the specified file over the target file, if only one source is given, or move the specified files and directories into the target directory, if the target is a directory.