Skip to main content

plot/lib/core/
help.rs

1pub fn print_help_for_pattern_syntax_and_semantics() {
2	println!(
3		r#"
4======================================================================
5🔎 PATTERN SYNTAX AND SEMANTICS
6======================================================================
7
81. BASICS (GLOB):
9   * - Matches any sequence of characters (except directory separators `/`)
10   ** - Matches anything including subdirectories (recursive)
11   ?        - Matches exactly one character
12
132. BRACE EXPANSION:
14   {{a,b,c}}  - Matches 'a', 'b', or 'c'
15   *.{{rs,md}} - Expands to '*.rs' and '*.md'
16
173. RELATIONAL OPERATORS (CONTEXT RULES):
18   @        - Requires a sibling. E.g., `@*.rs` (the .rs file must have an adjacent file/dir with the same base name)
19   $        - Orphan. E.g., `$*.rs` (the .rs file MUST NOT have a sibling)
20   +        - Deep mode: includes the entire contents of a directory. E.g., `src/+`
21
224. PARENT MODIFIERS (PARENT INCLUSION):
23   &/ OR &\ - Includes all parent directories for the matched file in the
24              result. Essential to prevent files from hanging in a void
25              when rendering a tree structure. E.g., `*.rs&/`
26
275. NEGATION:
28   !        - Excludes files matching the pattern. E.g., `!*.log`
29
30Usage example:
31cargo plot -b -p "*.{{rs,toml}}&/" "!target/**"
32"#
33	);
34}
35
36pub fn print_help_for_toml_config() {
37	println!(
38		r#"
39======================================================================
40⚙️  AUTOMATIZATION & TOML CONFIGURATION
41======================================================================
42
43You can define batch jobs in a TOML configuration file.
44Default path: ./target/.cargo-plot/tasks/CargoPlot.toml
45
461. JOB METADATA:
47   [[job]]
48   id = "a1"              # Unique identifier for the job
49   description = "..."    # Optional description
50   run-mode = ["save"]    # Execution modes: "dry-run", "save", "print-color", etc.
51
522. EXPLORER ([explorer]):
53   workspace-dir = "."    # Base directory to scan
54   ignore-case = false    # Case insensitive matching
55   patterns = ["*.rs"]    # Array of match patterns
56   parts = ["MD", "MF"]   # Matched Dirs, Matched Files, etc. (MD, MF, XD, XF)
57
583. EXPORT OPTIONS ([export]):
59   out-dir = "./out/"     # Output directory for reports
60   title = "Title"        # Report header title
61   name = "MyReport"      # Output file base name
62   name-is-first = false  # Put name at the beginning of the file name
63   save-separately = true # Split INDEX (SOTC) and FILES (COTS)
64
654. ATTRIBUTES & FORMATTING ([attributes]):
66   select = ["date", "time", "size", "path", "item"] # Columns to show
67   for-item = ["list-tree", "icons-more"]            # Item styling (list-tree, list-flat, icons-hide...)
68   for-date = "%Y-%m-%d"                             # Date formatting
69   for-time = "%H:%M:%S"                             # Time formatting
70   for-size = "decimal"                              # "decimal" or "binary"
71
725. PILE & SORT ([tuples.pile] & [tuples.sort]):
73   [tuples.pile]
74   type = "name"          # Grouping strategy ("name", "exte")
75   dir-first = true       # Dirs first in groups
76   same-name-dirs-and-files-nearby = true
77
78   [tuples.sort]
79   type = "name"          # Sort by ("date", "size", "path", "name")
80   reverse = false
81   string-strategy = ["AaZz", "Num", "Spec"]
82
83Usage examples:
84cargo plot -l                 # Runs the configuration from default TOML
85cargo plot -l ./custom.toml   # Runs the configuration from a specific file
86"#
87	);
88}