From 5e6bfa681aff03fbd683f81a9f4daa56b49d1344 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 31 Dec 2020 13:18:53 -0800 Subject: [PATCH] add vdir info --- README.md | 2 +- docs/parsers/ls.md | 4 ++-- jc/parsers/ls.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b026d727..900430b2 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio - `--jobs` enables the `jobs` command parser - `--kv` enables the `Key/Value` file parser - `--last` enables the `last` and `lastb` command parser -- `--ls` enables the `ls` command parser +- `--ls` enables the `ls` and `vdir` command parser - `--lsblk` enables the `lsblk` command parser - `--lsmod` enables the `lsmod` command parser - `--lsof` enables the `lsof` command parser diff --git a/docs/parsers/ls.md b/docs/parsers/ls.md index c46ee00c..6c7b480c 100644 --- a/docs/parsers/ls.md +++ b/docs/parsers/ls.md @@ -1,13 +1,13 @@ # jc.parsers.ls -jc - JSON CLI output utility `ls` command output parser +jc - JSON CLI output utility `ls` and `vdir` command output parser Options supported: - `lbaR` - `--time-style=full-iso` - `-h`: File sizes will be available in text form with `-r` but larger file sizes with human readable suffixes will be converted to `Null` in the default view since the parser attempts to convert this field to an integer. -Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. Since `ls` does not encode newlines in filenames when outputting to a pipe it will cause `jc` to see multiple files instead of a single file if `-l` or `-b` is not used. +Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. Since `ls` does not encode newlines in filenames when outputting to a pipe it will cause `jc` to see multiple files instead of a single file if `-l` or `-b` is not used. Alternatively, `vdir` can be used, which is the same as running `ls -lb`. Usage (cli): diff --git a/jc/parsers/ls.py b/jc/parsers/ls.py index f7a6e38d..91a40b7c 100644 --- a/jc/parsers/ls.py +++ b/jc/parsers/ls.py @@ -1,11 +1,11 @@ -"""jc - JSON CLI output utility `ls` command output parser +"""jc - JSON CLI output utility `ls` and `vdir` command output parser Options supported: - `lbaR` - `--time-style=full-iso` - `-h`: File sizes will be available in text form with `-r` but larger file sizes with human readable suffixes will be converted to `Null` in the default view since the parser attempts to convert this field to an integer. -Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. Since `ls` does not encode newlines in filenames when outputting to a pipe it will cause `jc` to see multiple files instead of a single file if `-l` or `-b` is not used. +Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. Since `ls` does not encode newlines in filenames when outputting to a pipe it will cause `jc` to see multiple files instead of a single file if `-l` or `-b` is not used. Alternatively, `vdir` can be used, which is the same as running `ls -lb`. Usage (cli): @@ -160,7 +160,7 @@ class info(): # compatible options: linux, darwin, cygwin, win32, aix, freebsd compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd'] - magic_commands = ['ls'] + magic_commands = ['ls', 'vdir'] __version__ = info.version