https://github.com/linqlover/uip-exercise-1
A simple command-line application for a Qt/C++ library that was developed as part of a study exercise.
https://github.com/linqlover/uip-exercise-1
cli cpp exercise qt
Last synced: about 2 months ago
JSON representation
A simple command-line application for a Qt/C++ library that was developed as part of a study exercise.
- Host: GitHub
- URL: https://github.com/linqlover/uip-exercise-1
- Owner: LinqLover
- Created: 2020-11-23T16:49:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-10T20:22:59.000Z (over 5 years ago)
- Last Synced: 2025-04-05T15:27:09.611Z (about 1 year ago)
- Topics: cli, cpp, exercise, qt
- Language: C++
- Homepage:
- Size: 219 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# uip-exercise-1 [](https://github.com/LinqLover/uip-exercise-1/actions?query=workflow%3A.github%2Fworkflows%2Fmain.yml)
Solution for a study exercise on programming a command-line interface (CLI). The `pscom` module was provided as a negative example of a library.
## Command Line Interface
```
sage: ./pscom-cli/bin/pscom-clid [options] command
Photo system command-line tool
Options:
-h, --help, -? Displays help on command-line options.
-V, --version Displays version information.
-v, --verbose Verbose mode. Specify up to 2 times to increase
the verbosity level of output messages. Opposite
of quiet mode.
-q, --quiet Quiet mode. Specify up to 2 times to decrease the
verbosity level of output messages. Opposite of
verbose mode.
--on-conflict Conflict resolution strategy to be applied when a
destructive operation is run. Can be one of the
following:
- overwrite: Overwrite the original file
irrecoverably.
- skip: Just forget this incident and continue
with the next file.
- backup: Create a backup of the original file (by
appending a squiggle (~) to its file name) and
then overwrite it.
-f, --force Enforce possibly destructive operations
regardless of the consequences. Equivalent to
on-conflict=overwrite.
--supported-formats Display all supported image formats.
-d, -C, --directory The directory to look up image files. Pass a
single dash (-) to enter a list of image files
interactively.
-R, --recursive Include subdirectories.
-r, --regex A regular expression to filter image files. Does
not need to match the entire file name; use text
anchors (^ $) for full matches.
--min, --min-date Reject images older than the given date and time.
--max, --max-date Reject images newer than the given date and time.
NOTE: If you only specify the date, it will be
treated as midnight time.
--dry-run Only simulate all modifications to the filesystem
instead of actually applying them. Can be helpful
to understand the consequences of your complicated
invocation without hazarding your entire photo
library.
--width The width the images should be fit into.
--height The height the images should be fit into.
--format The file format (e.g. jpg or png) the images
should be converted into.
--quality The quality for image conversion. Value between 0
(best compression) and 100 (best quality).
Arguments:
command The operation to perform.
Commands:
pscom Execute a symbol from the pscom library manually.
No safety checks! Intended for debugging purposes
only.
list, ls Display image files.
copy, cp Copy image files into the specified destination
folder.
move, mv Move image files into the specified destination
folder.
rename, rn [] Rename image files according to the given schema,
or according to the UPA standard, if omitted. To
escape date specifiers in the schema, enclose
literal parts into single quotes (', or "'" from
the bash shell).
group, g [] Group image files into subdirectories according
to the given schema, or according to the UPA
standard, if omitted. To escape date specifiers in
the schema, enclose literal parts into single
quotes (', or "'" from the bash shell).
resize Resize image files into the given dimensions.
convert Convert image files into a different file format
and/or quality.
```