Skip to content

Commit

Permalink
shelephant_get: allow showing only (but all) changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Nov 25, 2022
1 parent 58c5f93 commit a8d5650
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions shelephant/cli/shelephant_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
-d, --details
Print details (and no summary unless specified).
--changes
Print changed filed only, do not print skipped files. (Can be combined with ``--details``.)
-f, --force
Force overwrite of all existing (but not matching) files.
Expand Down Expand Up @@ -87,6 +90,7 @@ def print_help(self):
parser.add_argument("--colors", default="dark")
parser.add_argument("-s", "--summary", action="store_true")
parser.add_argument("-d", "--details", action="store_true")
parser.add_argument("--changes", action="store_true")
parser.add_argument("-f", "--force", action="store_true")
parser.add_argument("--verbose", action="store_true")
parser.add_argument("-q", "--quiet", action="store_true")
Expand Down Expand Up @@ -118,6 +122,7 @@ def print_help(self):
print_details=not (args.force or args.summary) or args.details,
print_summary=not (args.force or args.details) or args.summary,
print_all=args.details,
print_skipped=not args.changes,
theme_name=args.colors.lower(),
yaml_hostinfo_src=source,
yaml_hostinfo_dest=args.local,
Expand All @@ -140,6 +145,7 @@ def print_help(self):
print_details=not (args.force or args.summary) or args.details,
print_summary=not (args.force or args.details) or args.summary,
print_all=args.details,
print_skipped=not args.changes,
verbose=args.verbose,
theme_name=args.colors.lower(),
yaml_hostinfo_src=source,
Expand All @@ -163,6 +169,7 @@ def print_help(self):
print_details=not (args.force or args.summary) or args.details,
print_summary=not (args.force or args.details) or args.summary,
print_all=args.details,
print_skipped=not args.changes,
verbose=args.verbose,
theme_name=args.colors.lower(),
yaml_hostinfo_src=source,
Expand Down
8 changes: 6 additions & 2 deletions shelephant/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def copy(
print_details=True,
print_summary=True,
print_all=False,
print_skipped=True,
theme_name="none",
yaml_hostinfo_src=None,
yaml_hostinfo_dest=None,
Expand All @@ -55,6 +56,7 @@ def copy(
:param bool print_details: Print copy details.
:param bool print_summary: Print copy summary.
:param bool print_all: If ``False`` auto-truncation of long output is applied.
:param bool print_skipped: If ``False`` skipped files are not printed.
:type theme_name: str or None
:param theme_name: The name of the color-theme. See :py:mod:`shelephant.rich.theme`.
Expand Down Expand Up @@ -171,7 +173,7 @@ def copy(
String(files[i], color=color["new"]).format(),
)
)
elif skip[i] and pskip:
elif skip[i] and pskip and print_skipped:
print(
"{:s} {:s} {:s}".format(
String(files[i], width=width, color=color["skip"]).format(),
Expand Down Expand Up @@ -226,6 +228,7 @@ def copy_ssh(
print_details=True,
print_summary=True,
print_all=False,
print_skipped=True,
verbose=False,
theme_name="none",
yaml_hostinfo_src=None,
Expand Down Expand Up @@ -254,6 +257,7 @@ def copy_ssh(
:param bool print_details: Print copy details.
:param bool print_summary: Print copy summary.
:param bool print_all: If ``False`` auto-truncation of long output is applied.
:param bool print_skipped: If ``False`` skipped files are not printed.
:type theme_name: str or None
:param theme_name: The name of the color-theme. See :py:fun:`shelephant.rich.theme`.
Expand Down Expand Up @@ -385,7 +389,7 @@ def copy_ssh(
String(files[i], color=color["new"]).format(),
)
)
elif skip[i] and pskip:
elif skip[i] and pskip and print_skipped:
print(
"{:s} {:s} {:s}".format(
String(files[i], width=width, color=color["skip"]).format(),
Expand Down

0 comments on commit a8d5650

Please sign in to comment.