Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,60 @@ | ||
# c4 - Command line interface | ||
# `c4` Command Line Interface | ||
|
||
This version of the c4 cli generates ids for individual files and folders, file system hierarchies, and piped data. | ||
C4 is a command line tool for generating C4 IDs for files, folders and piped data. | ||
|
||
## Examples | ||
## Features | ||
|
||
Id a file: | ||
- Generate C4 IDs for files and directory hierarchies. | ||
- Generate C4 IDs while copying files. | ||
- Stores snapshots of hierarchy scans with filenames, C4 IDs and file metadata. | ||
- Applies tags to file system snapshots. | ||
- Compare two snapshots of the same folder at different times or two different folders. | ||
- Provides a set of instructions that would synchronize one folder to another. | ||
|
||
And more on the way. | ||
|
||
The C4 tool is primarily used to quickly identifying files, and folders, it can do | ||
this most efficiently in a media production pipeline by using it to copy files instead of | ||
`cp` or `copy`. When copying `c4` will ID the file while copying at the same time and store the result for future reference. If a file is unmodified from the most recently | ||
identified copy, then c4 uses the stored ID instead of re-identifying the file. | ||
|
||
C4 can tag snapshots of the file system, and retain those snapshots for future reference. | ||
|
||
C4 only stores the paths, file metadata, and C4 ID. It is the users responsibility to | ||
retain copies of files if users wish to revert changes to previously tagged versions. C4 can provide a "patch" or set of operations that can be used make a directory match a snapshot or source directory. | ||
|
||
To id a file | ||
|
||
```bash | ||
$ c4 c4.go | ||
$ c4 id [filename] | ||
c41YXr8u3uZC5kkwUr27TZkoYRYDprZmr8YCBJ13quTggGvjGrxMJzzF9qcoFhyGr5rxP2dMtySJevJqQbC3R3hzyE | ||
``` | ||
|
||
Id all files and folders recursively: | ||
To copy files or folders | ||
|
||
```bash | ||
$ c4 -R ./cmd | ||
c43XLLxd2sNhqjUPWL8xYqoq7gmU1SZA675m1zS7jFVPRKTx7hTANQEu6RaY286uqEpbqBZKpoPNfzNSNQEVthQ7H7: cmd/c4/Readme.md | ||
c44m2stxSN9Wz7sAoNgPttVQ8xFzzEW4xP3huPuTXbT93MpwYPK5AmDPR4wANjFWZHBE7kNsLm73hH1YopZawtRfRK: cmd/c4/main.go | ||
c45agVTfUYSMumK4ohzsnTo7X8QZtytNDTzo62tAzw8dnCMwe9GhHWwwotWBUdHwoXY9qqoSUqWrtmQJb1AQ1cTdaR: cmd/c4 | ||
c44AvENJsDgamsSoBh7yCZHRkyn9NMbckZCY7VEVPxqfLfxNLeVmDNJ9nTugLYcyi2JYP492exkNS7KTAhoDwVms3z: cmd/c4id/README.md | ||
c45wRLpVXHr8FYD2GP8ZzKnGJ3GiwmWFDJCwhQ5sh8zdznp5tFXfszCe1wqrcFBZ8b3nPkYNfLqt4Y48WbbUeT7pqr: cmd/c4id/main.go | ||
c45p5snKG8z3vU6QcM3buW8r3LAQUeKQLUFcvqTCBJZr3Uzn8PMZrBbvF5dRvmaR4A9AEZLEwHnSFkixBkyE8dRoRU: cmd/c4id | ||
c436eg2b8W9Rguo6B9Arve1Lmh9sgkRJtXBvxvZjTdwmPMByTtjL7WourHQkb1HZz9mKBxEB9F5i4hq1S24N1ijwSB: cmd | ||
$ c4 cp sourcefile targetfile | ||
c42gCHUDtmQV2V7Zv3NCk1WFSVszLe4xCC7hRwUU1awTnUdjnTysxCoHmkVduWE4tX4dsJ4xNEZpNvuiC74vJiPxTJ: sourcefile -> targetfile | ||
|
||
$ c4 cp -R sourcefolder targetfolder | ||
c41YXr8u3uZC5kkwUr27TZkoYRYDprZmr8YCBJ13quTggGvjGrxMJzzF9qcoFhyGr5rxP2dMtySJevJqQbC3R3hzyE: sourcefolder/file1.data -> targetfolder/file1.data | ||
c45VWLhapqAhdyWeQH5rWr6WMdUsbDY2X3MAycQohPpvJJeLB2AAKqw8RmCNgLCGuAPw9Sg7ywurSCmH7xCf86Y9zN: | ||
sourcefolder/file2.data -> targetfolder/file2.data | ||
... | ||
``` | ||
|
||
### Help output: | ||
### flags | ||
|
||
```bash | ||
Usage: c4 [flags] [file] | ||
|
||
c4 generates c4ids for all files and folders spacified. | ||
If no file is given c4 will read piped data. | ||
Output is in YAML format. | ||
|
||
flags: | ||
-a, --absolute=false: Output absolute paths, instead of relative paths. | ||
-a, --absolute: Output absolute paths, instead of relative paths. | ||
-d, --depth=0: Only output ids for files and folders 'depth' directories deep. | ||
-f, --formatting="id": Output formatting options. | ||
"id": c4id oriented. | ||
"path": path oriented. | ||
-L, --links=false: All symbolic links are followed. | ||
-m, --metadata=false: Include filesystem metadata. | ||
"url" is always included unless data is piped, or only a single file is specified. | ||
-R, --recursive=false: Recursively identify all files for the given url. | ||
-v, --version=false: Show version information. | ||
-L, --links: All symbolic links are followed. | ||
-m, --metadata: Include filesystem metadata. | ||
"path" is always included unless data is piped, or only a single file is specified. | ||
-R, --recursive: Recursively identify all files for the given path. | ||
-v, --version: Show version information. | ||
``` | ||
|
||
|
||
|