repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

packages: custom simple package manager

065723132b3da25313b9f48ca1defc1c0435d2bf

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (14)

+1279 / −3763 text lines

Diff layout

justfile

Modified

+5 / −1 text lines

1616 java bootstripper.java decrypt
1818# install rust user land
19tools:
19crates:
2020 cd tools;java install.java
22# install packages
23packages:
24 cd tools;nu packages.nu
25
2226# typically the initial git remote for the dotfiles repo is https
2327# this command changes the remote to ssh
2428ssh-remote:

nushell/completions/jj-completions.nu

Modified

+0 / −2396 text lines

1module completions {
2
3 # Jujutsu (An experimental VCS)
4 export extern jj [
5 --repository(-R): string # Path to repository to operate on
6 --ignore-working-copy # Don't snapshot the working copy, and don't update it
7 --ignore-immutable # Allow rewriting immutable commits
8 --at-operation: string # Operation to load the repo at
9 --at-op: string # Operation to load the repo at
10 --debug # Enable debug logging
11 --color: string # When to colorize output (always, never, debug, auto)
12 --quiet # Silence non-primary command output
13 --no-pager # Disable the pager
14 --config-toml: string # Additional configuration options (can be repeated)
15 --help(-h) # Print help (see more with '--help')
16 --version(-V) # Print version
17 ]
19 # Abandon a revision
20 export extern "jj abandon" [
21 ...revisions: string # The revision(s) to abandon
22 --summary(-s) # Do not print every abandoned commit on a separate line
23 -r # Ignored (but lets you pass `-r` for consistency with other commands)
24 --restore-descendants # Do not modify the content of the children of the abandoned commits
25 --repository(-R): string # Path to repository to operate on
26 --ignore-working-copy # Don't snapshot the working copy, and don't update it
27 --ignore-immutable # Allow rewriting immutable commits
28 --at-operation: string # Operation to load the repo at
29 --at-op: string # Operation to load the repo at
30 --debug # Enable debug logging
31 --color: string # When to colorize output (always, never, debug, auto)
32 --quiet # Silence non-primary command output
33 --no-pager # Disable the pager
34 --config-toml: string # Additional configuration options (can be repeated)
35 --help(-h) # Print help (see more with '--help')
36 ]
38 # Move changes from a revision into the stack of mutable revisions
39 export extern "jj absorb" [
40 --from(-f): string # Source revision to absorb from
41 --into(-t): string # Destination revisions to absorb into
42 --to: string # Destination revisions to absorb into
43 ...paths: string # Move only changes to these paths (instead of all paths)
44 --repository(-R): string # Path to repository to operate on
45 --ignore-working-copy # Don't snapshot the working copy, and don't update it
46 --ignore-immutable # Allow rewriting immutable commits
47 --at-operation: string # Operation to load the repo at
48 --at-op: string # Operation to load the repo at
49 --debug # Enable debug logging
50 --color: string # When to colorize output (always, never, debug, auto)
51 --quiet # Silence non-primary command output
52 --no-pager # Disable the pager
53 --config-toml: string # Additional configuration options (can be repeated)
54 --help(-h) # Print help (see more with '--help')
55 ]
57 # Apply the reverse of a revision on top of another revision
58 export extern "jj backout" [
59 --revisions(-r): string # The revision(s) to apply the reverse of
60 --destination(-d): string # The revision to apply the reverse changes on top of
61 --repository(-R): string # Path to repository to operate on
62 --ignore-working-copy # Don't snapshot the working copy, and don't update it
63 --ignore-immutable # Allow rewriting immutable commits
64 --at-operation: string # Operation to load the repo at
65 --at-op: string # Operation to load the repo at
66 --debug # Enable debug logging
67 --color: string # When to colorize output (always, never, debug, auto)
68 --quiet # Silence non-primary command output
69 --no-pager # Disable the pager
70 --config-toml: string # Additional configuration options (can be repeated)
71 --help(-h) # Print help (see more with '--help')
72 ]
74 # Manage bookmarks [default alias: b]
75 export extern "jj bookmark" [
76 --repository(-R): string # Path to repository to operate on
77 --ignore-working-copy # Don't snapshot the working copy, and don't update it
78 --ignore-immutable # Allow rewriting immutable commits
79 --at-operation: string # Operation to load the repo at
80 --at-op: string # Operation to load the repo at
81 --debug # Enable debug logging
82 --color: string # When to colorize output (always, never, debug, auto)
83 --quiet # Silence non-primary command output
84 --no-pager # Disable the pager
85 --config-toml: string # Additional configuration options (can be repeated)
86 --help(-h) # Print help (see more with '--help')
87 ]
89 # Create a new bookmark
90 export extern "jj bookmark create" [
91 --revision(-r): string # The bookmark's target revision
92 --to: string # The bookmark's target revision
93 ...names: string # The bookmarks to create
94 --repository(-R): string # Path to repository to operate on
95 --ignore-working-copy # Don't snapshot the working copy, and don't update it
96 --ignore-immutable # Allow rewriting immutable commits
97 --at-operation: string # Operation to load the repo at
98 --at-op: string # Operation to load the repo at
99 --debug # Enable debug logging
100 --color: string # When to colorize output (always, never, debug, auto)
101 --quiet # Silence non-primary command output
102 --no-pager # Disable the pager
103 --config-toml: string # Additional configuration options (can be repeated)
104 --help(-h) # Print help (see more with '--help')
105 ]
107 # Delete an existing bookmark and propagate the deletion to remotes on the next push
108 export extern "jj bookmark delete" [
109 ...names: string # The bookmarks to delete
110 --repository(-R): string # Path to repository to operate on
111 --ignore-working-copy # Don't snapshot the working copy, and don't update it
112 --ignore-immutable # Allow rewriting immutable commits
113 --at-operation: string # Operation to load the repo at
114 --at-op: string # Operation to load the repo at
115 --debug # Enable debug logging
116 --color: string # When to colorize output (always, never, debug, auto)
117 --quiet # Silence non-primary command output
118 --no-pager # Disable the pager
119 --config-toml: string # Additional configuration options (can be repeated)
120 --help(-h) # Print help (see more with '--help')
121 ]
123 # Forget everything about a bookmark, including its local and remote targets
124 export extern "jj bookmark forget" [
125 ...names: string # The bookmarks to forget
126 --repository(-R): string # Path to repository to operate on
127 --ignore-working-copy # Don't snapshot the working copy, and don't update it
128 --ignore-immutable # Allow rewriting immutable commits
129 --at-operation: string # Operation to load the repo at
130 --at-op: string # Operation to load the repo at
131 --debug # Enable debug logging
132 --color: string # When to colorize output (always, never, debug, auto)
133 --quiet # Silence non-primary command output
134 --no-pager # Disable the pager
135 --config-toml: string # Additional configuration options (can be repeated)
136 --help(-h) # Print help (see more with '--help')
137 ]
139 # List bookmarks and their targets
140 export extern "jj bookmark list" [
141 --all-remotes(-a) # Show all tracking and non-tracking remote bookmarks including the ones whose targets are synchronized with the local bookmarks
142 --remote: string # Show all tracking and non-tracking remote bookmarks belonging to this remote
143 --tracked(-t) # Show remote tracked bookmarks only. Omits local Git-tracking bookmarks by default
144 --conflicted(-c) # Show conflicted bookmarks only
145 ...names: string # Show bookmarks whose local name matches
146 --revisions(-r): string # Show bookmarks whose local targets are in the given revisions
147 --template(-T): string # Render each bookmark using the given template
148 --repository(-R): string # Path to repository to operate on
149 --ignore-working-copy # Don't snapshot the working copy, and don't update it
150 --ignore-immutable # Allow rewriting immutable commits
151 --at-operation: string # Operation to load the repo at
152 --at-op: string # Operation to load the repo at
153 --debug # Enable debug logging
154 --color: string # When to colorize output (always, never, debug, auto)
155 --quiet # Silence non-primary command output
156 --no-pager # Disable the pager
157 --config-toml: string # Additional configuration options (can be repeated)
158 --help(-h) # Print help (see more with '--help')
159 ]
161 # Move existing bookmarks to target revision
162 export extern "jj bookmark move" [
163 --from: string # Move bookmarks from the given revisions
164 --to: string # Move bookmarks to this revision
165 --allow-backwards(-B) # Allow moving bookmarks backwards or sideways
166 ...names: string # Move bookmarks matching the given name patterns
167 --repository(-R): string # Path to repository to operate on
168 --ignore-working-copy # Don't snapshot the working copy, and don't update it
169 --ignore-immutable # Allow rewriting immutable commits
170 --at-operation: string # Operation to load the repo at
171 --at-op: string # Operation to load the repo at
172 --debug # Enable debug logging
173 --color: string # When to colorize output (always, never, debug, auto)
174 --quiet # Silence non-primary command output
175 --no-pager # Disable the pager
176 --config-toml: string # Additional configuration options (can be repeated)
177 --help(-h) # Print help (see more with '--help')
178 ]
180 # Rename `old` bookmark name to `new` bookmark name
181 export extern "jj bookmark rename" [
182 old: string # The old name of the bookmark
183 new: string # The new name of the bookmark
184 --repository(-R): string # Path to repository to operate on
185 --ignore-working-copy # Don't snapshot the working copy, and don't update it
186 --ignore-immutable # Allow rewriting immutable commits
187 --at-operation: string # Operation to load the repo at
188 --at-op: string # Operation to load the repo at
189 --debug # Enable debug logging
190 --color: string # When to colorize output (always, never, debug, auto)
191 --quiet # Silence non-primary command output
192 --no-pager # Disable the pager
193 --config-toml: string # Additional configuration options (can be repeated)
194 --help(-h) # Print help (see more with '--help')
195 ]
197 # Create or update a bookmark to point to a certain commit
198 export extern "jj bookmark set" [
199 --revision(-r): string # The bookmark's target revision
200 --to: string # The bookmark's target revision
201 --allow-backwards(-B) # Allow moving the bookmark backwards or sideways
202 ...names: string # The bookmarks to update
203 --repository(-R): string # Path to repository to operate on
204 --ignore-working-copy # Don't snapshot the working copy, and don't update it
205 --ignore-immutable # Allow rewriting immutable commits
206 --at-operation: string # Operation to load the repo at
207 --at-op: string # Operation to load the repo at
208 --debug # Enable debug logging
209 --color: string # When to colorize output (always, never, debug, auto)
210 --quiet # Silence non-primary command output
211 --no-pager # Disable the pager
212 --config-toml: string # Additional configuration options (can be repeated)
213 --help(-h) # Print help (see more with '--help')
214 ]
216 # Start tracking given remote bookmarks
217 export extern "jj bookmark track" [
218 ...names: string # Remote bookmarks to track
219 --repository(-R): string # Path to repository to operate on
220 --ignore-working-copy # Don't snapshot the working copy, and don't update it
221 --ignore-immutable # Allow rewriting immutable commits
222 --at-operation: string # Operation to load the repo at
223 --at-op: string # Operation to load the repo at
224 --debug # Enable debug logging
225 --color: string # When to colorize output (always, never, debug, auto)
226 --quiet # Silence non-primary command output
227 --no-pager # Disable the pager
228 --config-toml: string # Additional configuration options (can be repeated)
229 --help(-h) # Print help (see more with '--help')
230 ]
232 # Stop tracking given remote bookmarks
233 export extern "jj bookmark untrack" [
234 ...names: string # Remote bookmarks to untrack
235 --repository(-R): string # Path to repository to operate on
236 --ignore-working-copy # Don't snapshot the working copy, and don't update it
237 --ignore-immutable # Allow rewriting immutable commits
238 --at-operation: string # Operation to load the repo at
239 --at-op: string # Operation to load the repo at
240 --debug # Enable debug logging
241 --color: string # When to colorize output (always, never, debug, auto)
242 --quiet # Silence non-primary command output
243 --no-pager # Disable the pager
244 --config-toml: string # Additional configuration options (can be repeated)
245 --help(-h) # Print help (see more with '--help')
246 ]
248 # Manage bookmarks [default alias: b]
249 export extern "jj branch" [
250 --repository(-R): string # Path to repository to operate on
251 --ignore-working-copy # Don't snapshot the working copy, and don't update it
252 --ignore-immutable # Allow rewriting immutable commits
253 --at-operation: string # Operation to load the repo at
254 --at-op: string # Operation to load the repo at
255 --debug # Enable debug logging
256 --color: string # When to colorize output (always, never, debug, auto)
257 --quiet # Silence non-primary command output
258 --no-pager # Disable the pager
259 --config-toml: string # Additional configuration options (can be repeated)
260 --help(-h) # Print help (see more with '--help')
261 ]
263 # Create a new bookmark
264 export extern "jj branch create" [
265 --revision(-r): string # The bookmark's target revision
266 --to: string # The bookmark's target revision
267 ...names: string # The bookmarks to create
268 --repository(-R): string # Path to repository to operate on
269 --ignore-working-copy # Don't snapshot the working copy, and don't update it
270 --ignore-immutable # Allow rewriting immutable commits
271 --at-operation: string # Operation to load the repo at
272 --at-op: string # Operation to load the repo at
273 --debug # Enable debug logging
274 --color: string # When to colorize output (always, never, debug, auto)
275 --quiet # Silence non-primary command output
276 --no-pager # Disable the pager
277 --config-toml: string # Additional configuration options (can be repeated)
278 --help(-h) # Print help (see more with '--help')
279 ]
281 # Delete an existing bookmark and propagate the deletion to remotes on the next push
282 export extern "jj branch delete" [
283 ...names: string # The bookmarks to delete
284 --repository(-R): string # Path to repository to operate on
285 --ignore-working-copy # Don't snapshot the working copy, and don't update it
286 --ignore-immutable # Allow rewriting immutable commits
287 --at-operation: string # Operation to load the repo at
288 --at-op: string # Operation to load the repo at
289 --debug # Enable debug logging
290 --color: string # When to colorize output (always, never, debug, auto)
291 --quiet # Silence non-primary command output
292 --no-pager # Disable the pager
293 --config-toml: string # Additional configuration options (can be repeated)
294 --help(-h) # Print help (see more with '--help')
295 ]
297 # Forget everything about a bookmark, including its local and remote targets
298 export extern "jj branch forget" [
299 ...names: string # The bookmarks to forget
300 --repository(-R): string # Path to repository to operate on
301 --ignore-working-copy # Don't snapshot the working copy, and don't update it
302 --ignore-immutable # Allow rewriting immutable commits
303 --at-operation: string # Operation to load the repo at
304 --at-op: string # Operation to load the repo at
305 --debug # Enable debug logging
306 --color: string # When to colorize output (always, never, debug, auto)
307 --quiet # Silence non-primary command output
308 --no-pager # Disable the pager
309 --config-toml: string # Additional configuration options (can be repeated)
310 --help(-h) # Print help (see more with '--help')
311 ]
313 # List bookmarks and their targets
314 export extern "jj branch list" [
315 --all-remotes(-a) # Show all tracking and non-tracking remote bookmarks including the ones whose targets are synchronized with the local bookmarks
316 --remote: string # Show all tracking and non-tracking remote bookmarks belonging to this remote
317 --tracked(-t) # Show remote tracked bookmarks only. Omits local Git-tracking bookmarks by default
318 --conflicted(-c) # Show conflicted bookmarks only
319 ...names: string # Show bookmarks whose local name matches
320 --revisions(-r): string # Show bookmarks whose local targets are in the given revisions
321 --template(-T): string # Render each bookmark using the given template
322 --repository(-R): string # Path to repository to operate on
323 --ignore-working-copy # Don't snapshot the working copy, and don't update it
324 --ignore-immutable # Allow rewriting immutable commits
325 --at-operation: string # Operation to load the repo at
326 --at-op: string # Operation to load the repo at
327 --debug # Enable debug logging
328 --color: string # When to colorize output (always, never, debug, auto)
329 --quiet # Silence non-primary command output
330 --no-pager # Disable the pager
331 --config-toml: string # Additional configuration options (can be repeated)
332 --help(-h) # Print help (see more with '--help')
333 ]
335 # Move existing bookmarks to target revision
336 export extern "jj branch move" [
337 --from: string # Move bookmarks from the given revisions
338 --to: string # Move bookmarks to this revision
339 --allow-backwards(-B) # Allow moving bookmarks backwards or sideways
340 ...names: string # Move bookmarks matching the given name patterns
341 --repository(-R): string # Path to repository to operate on
342 --ignore-working-copy # Don't snapshot the working copy, and don't update it
343 --ignore-immutable # Allow rewriting immutable commits
344 --at-operation: string # Operation to load the repo at
345 --at-op: string # Operation to load the repo at
346 --debug # Enable debug logging
347 --color: string # When to colorize output (always, never, debug, auto)
348 --quiet # Silence non-primary command output
349 --no-pager # Disable the pager
350 --config-toml: string # Additional configuration options (can be repeated)
351 --help(-h) # Print help (see more with '--help')
352 ]
354 # Rename `old` bookmark name to `new` bookmark name
355 export extern "jj branch rename" [
356 old: string # The old name of the bookmark
357 new: string # The new name of the bookmark
358 --repository(-R): string # Path to repository to operate on
359 --ignore-working-copy # Don't snapshot the working copy, and don't update it
360 --ignore-immutable # Allow rewriting immutable commits
361 --at-operation: string # Operation to load the repo at
362 --at-op: string # Operation to load the repo at
363 --debug # Enable debug logging
364 --color: string # When to colorize output (always, never, debug, auto)
365 --quiet # Silence non-primary command output
366 --no-pager # Disable the pager
367 --config-toml: string # Additional configuration options (can be repeated)
368 --help(-h) # Print help (see more with '--help')
369 ]
371 # Create or update a bookmark to point to a certain commit
372 export extern "jj branch set" [
373 --revision(-r): string # The bookmark's target revision
374 --to: string # The bookmark's target revision
375 --allow-backwards(-B) # Allow moving the bookmark backwards or sideways
376 ...names: string # The bookmarks to update
377 --repository(-R): string # Path to repository to operate on
378 --ignore-working-copy # Don't snapshot the working copy, and don't update it
379 --ignore-immutable # Allow rewriting immutable commits
380 --at-operation: string # Operation to load the repo at
381 --at-op: string # Operation to load the repo at
382 --debug # Enable debug logging
383 --color: string # When to colorize output (always, never, debug, auto)
384 --quiet # Silence non-primary command output
385 --no-pager # Disable the pager
386 --config-toml: string # Additional configuration options (can be repeated)
387 --help(-h) # Print help (see more with '--help')
388 ]
390 # Start tracking given remote bookmarks
391 export extern "jj branch track" [
392 ...names: string # Remote bookmarks to track
393 --repository(-R): string # Path to repository to operate on
394 --ignore-working-copy # Don't snapshot the working copy, and don't update it
395 --ignore-immutable # Allow rewriting immutable commits
396 --at-operation: string # Operation to load the repo at
397 --at-op: string # Operation to load the repo at
398 --debug # Enable debug logging
399 --color: string # When to colorize output (always, never, debug, auto)
400 --quiet # Silence non-primary command output
401 --no-pager # Disable the pager
402 --config-toml: string # Additional configuration options (can be repeated)
403 --help(-h) # Print help (see more with '--help')
404 ]
406 # Stop tracking given remote bookmarks
407 export extern "jj branch untrack" [
408 ...names: string # Remote bookmarks to untrack
409 --repository(-R): string # Path to repository to operate on
410 --ignore-working-copy # Don't snapshot the working copy, and don't update it
411 --ignore-immutable # Allow rewriting immutable commits
412 --at-operation: string # Operation to load the repo at
413 --at-op: string # Operation to load the repo at
414 --debug # Enable debug logging
415 --color: string # When to colorize output (always, never, debug, auto)
416 --quiet # Silence non-primary command output
417 --no-pager # Disable the pager
418 --config-toml: string # Additional configuration options (can be repeated)
419 --help(-h) # Print help (see more with '--help')
420 ]
422 # Print contents of files in a revision
423 export extern "jj cat" [
424 --revision(-r): string # The revision to get the file contents from
425 ...paths: string # Paths to print
426 --repository(-R): string # Path to repository to operate on
427 --ignore-working-copy # Don't snapshot the working copy, and don't update it
428 --ignore-immutable # Allow rewriting immutable commits
429 --at-operation: string # Operation to load the repo at
430 --at-op: string # Operation to load the repo at
431 --debug # Enable debug logging
432 --color: string # When to colorize output (always, never, debug, auto)
433 --quiet # Silence non-primary command output
434 --no-pager # Disable the pager
435 --config-toml: string # Additional configuration options (can be repeated)
436 --help(-h) # Print help (see more with '--help')
437 ]
439 def "nu-complete jj chmod mode" [] {
440 [ "n" "x" ]
441 }
443 # Sets or removes the executable bit for paths in the repo
444 export extern "jj chmod" [
445 mode: string@"nu-complete jj chmod mode"
446 --revision(-r): string # The revision to update
447 ...paths: string # Paths to change the executable bit for
448 --repository(-R): string # Path to repository to operate on
449 --ignore-working-copy # Don't snapshot the working copy, and don't update it
450 --ignore-immutable # Allow rewriting immutable commits
451 --at-operation: string # Operation to load the repo at
452 --at-op: string # Operation to load the repo at
453 --debug # Enable debug logging
454 --color: string # When to colorize output (always, never, debug, auto)
455 --quiet # Silence non-primary command output
456 --no-pager # Disable the pager
457 --config-toml: string # Additional configuration options (can be repeated)
458 --help(-h) # Print help (see more with '--help')
459 ]
461 # Update the description and create a new change on top
462 export extern "jj commit" [
463 --interactive(-i) # Interactively choose which changes to include in the first commit
464 --tool: string # Specify diff editor to be used (implies --interactive)
465 --message(-m): string # The change description to use (don't open editor)
466 ...paths: string # Put these paths in the first commit
467 --reset-author # Reset the author to the configured user
468 --author: string # Set author to the provided string
469 --repository(-R): string # Path to repository to operate on
470 --ignore-working-copy # Don't snapshot the working copy, and don't update it
471 --ignore-immutable # Allow rewriting immutable commits
472 --at-operation: string # Operation to load the repo at
473 --at-op: string # Operation to load the repo at
474 --debug # Enable debug logging
475 --color: string # When to colorize output (always, never, debug, auto)
476 --quiet # Silence non-primary command output
477 --no-pager # Disable the pager
478 --config-toml: string # Additional configuration options (can be repeated)
479 --help(-h) # Print help (see more with '--help')
480 ]
482 # Manage config options
483 export extern "jj config" [
484 --repository(-R): string # Path to repository to operate on
485 --ignore-working-copy # Don't snapshot the working copy, and don't update it
486 --ignore-immutable # Allow rewriting immutable commits
487 --at-operation: string # Operation to load the repo at
488 --at-op: string # Operation to load the repo at
489 --debug # Enable debug logging
490 --color: string # When to colorize output (always, never, debug, auto)
491 --quiet # Silence non-primary command output
492 --no-pager # Disable the pager
493 --config-toml: string # Additional configuration options (can be repeated)
494 --help(-h) # Print help (see more with '--help')
495 ]
497 # Start an editor on a jj config file
498 export extern "jj config edit" [
499 --user # Target the user-level config
500 --repo # Target the repo-level config
501 --repository(-R): string # Path to repository to operate on
502 --ignore-working-copy # Don't snapshot the working copy, and don't update it
503 --ignore-immutable # Allow rewriting immutable commits
504 --at-operation: string # Operation to load the repo at
505 --at-op: string # Operation to load the repo at
506 --debug # Enable debug logging
507 --color: string # When to colorize output (always, never, debug, auto)
508 --quiet # Silence non-primary command output
509 --no-pager # Disable the pager
510 --config-toml: string # Additional configuration options (can be repeated)
511 --help(-h) # Print help (see more with '--help')
512 ]
514 # Get the value of a given config option.
515 export extern "jj config get" [
516 name: string
517 --repository(-R): string # Path to repository to operate on
518 --ignore-working-copy # Don't snapshot the working copy, and don't update it
519 --ignore-immutable # Allow rewriting immutable commits
520 --at-operation: string # Operation to load the repo at
521 --at-op: string # Operation to load the repo at
522 --debug # Enable debug logging
523 --color: string # When to colorize output (always, never, debug, auto)
524 --quiet # Silence non-primary command output
525 --no-pager # Disable the pager
526 --config-toml: string # Additional configuration options (can be repeated)
527 --help(-h) # Print help (see more with '--help')
528 ]
530 # List variables set in config file, along with their values
531 export extern "jj config list" [
532 name?: string # An optional name of a specific config option to look up
533 --include-defaults # Whether to explicitly include built-in default values in the list
534 --include-overridden # Allow printing overridden values
535 --user # Target the user-level config
536 --repo # Target the repo-level config
537 --template(-T): string # Render each variable using the given template
538 --repository(-R): string # Path to repository to operate on
539 --ignore-working-copy # Don't snapshot the working copy, and don't update it
540 --ignore-immutable # Allow rewriting immutable commits
541 --at-operation: string # Operation to load the repo at
542 --at-op: string # Operation to load the repo at
543 --debug # Enable debug logging
544 --color: string # When to colorize output (always, never, debug, auto)
545 --quiet # Silence non-primary command output
546 --no-pager # Disable the pager
547 --config-toml: string # Additional configuration options (can be repeated)
548 --help(-h) # Print help (see more with '--help')
549 ]
551 # Print the path to the config file
552 export extern "jj config path" [
553 --user # Target the user-level config
554 --repo # Target the repo-level config
555 --repository(-R): string # Path to repository to operate on
556 --ignore-working-copy # Don't snapshot the working copy, and don't update it
557 --ignore-immutable # Allow rewriting immutable commits
558 --at-operation: string # Operation to load the repo at
559 --at-op: string # Operation to load the repo at
560 --debug # Enable debug logging
561 --color: string # When to colorize output (always, never, debug, auto)
562 --quiet # Silence non-primary command output
563 --no-pager # Disable the pager
564 --config-toml: string # Additional configuration options (can be repeated)
565 --help(-h) # Print help (see more with '--help')
566 ]
568 # Update config file to set the given option to a given value
569 export extern "jj config set" [
570 name: string
571 value: string
572 --user # Target the user-level config
573 --repo # Target the repo-level config
574 --repository(-R): string # Path to repository to operate on
575 --ignore-working-copy # Don't snapshot the working copy, and don't update it
576 --ignore-immutable # Allow rewriting immutable commits
577 --at-operation: string # Operation to load the repo at
578 --at-op: string # Operation to load the repo at
579 --debug # Enable debug logging
580 --color: string # When to colorize output (always, never, debug, auto)
581 --quiet # Silence non-primary command output
582 --no-pager # Disable the pager
583 --config-toml: string # Additional configuration options (can be repeated)
584 --help(-h) # Print help (see more with '--help')
585 ]
587 # Update config file to unset the given option
588 export extern "jj config unset" [
589 name: string
590 --user # Target the user-level config
591 --repo # Target the repo-level config
592 --repository(-R): string # Path to repository to operate on
593 --ignore-working-copy # Don't snapshot the working copy, and don't update it
594 --ignore-immutable # Allow rewriting immutable commits
595 --at-operation: string # Operation to load the repo at
596 --at-op: string # Operation to load the repo at
597 --debug # Enable debug logging
598 --color: string # When to colorize output (always, never, debug, auto)
599 --quiet # Silence non-primary command output
600 --no-pager # Disable the pager
601 --config-toml: string # Additional configuration options (can be repeated)
602 --help(-h) # Print help (see more with '--help')
603 ]
605 # Low-level commands not intended for users
606 export extern "jj debug" [
607 --repository(-R): string # Path to repository to operate on
608 --ignore-working-copy # Don't snapshot the working copy, and don't update it
609 --ignore-immutable # Allow rewriting immutable commits
610 --at-operation: string # Operation to load the repo at
611 --at-op: string # Operation to load the repo at
612 --debug # Enable debug logging
613 --color: string # When to colorize output (always, never, debug, auto)
614 --quiet # Silence non-primary command output
615 --no-pager # Disable the pager
616 --config-toml: string # Additional configuration options (can be repeated)
617 --help(-h) # Print help (see more with '--help')
618 ]
620 # Rebuild commit index
621 export extern "jj debug copy-detection" [
622 revision?: string # Show changes in this revision, compared to its parent(s)
623 --repository(-R): string # Path to repository to operate on
624 --ignore-working-copy # Don't snapshot the working copy, and don't update it
625 --ignore-immutable # Allow rewriting immutable commits
626 --at-operation: string # Operation to load the repo at
627 --at-op: string # Operation to load the repo at
628 --debug # Enable debug logging
629 --color: string # When to colorize output (always, never, debug, auto)
630 --quiet # Silence non-primary command output
631 --no-pager # Disable the pager
632 --config-toml: string # Additional configuration options (can be repeated)
633 --help(-h) # Print help (see more with '--help')
634 ]
636 # Parse fileset expression
637 export extern "jj debug fileset" [
638 path: string
639 --repository(-R): string # Path to repository to operate on
640 --ignore-working-copy # Don't snapshot the working copy, and don't update it
641 --ignore-immutable # Allow rewriting immutable commits
642 --at-operation: string # Operation to load the repo at
643 --at-op: string # Operation to load the repo at
644 --debug # Enable debug logging
645 --color: string # When to colorize output (always, never, debug, auto)
646 --quiet # Silence non-primary command output
647 --no-pager # Disable the pager
648 --config-toml: string # Additional configuration options (can be repeated)
649 --help(-h) # Print help (see more with '--help')
650 ]
652 # Show commit index stats
653 export extern "jj debug index" [
654 --repository(-R): string # Path to repository to operate on
655 --ignore-working-copy # Don't snapshot the working copy, and don't update it
656 --ignore-immutable # Allow rewriting immutable commits
657 --at-operation: string # Operation to load the repo at
658 --at-op: string # Operation to load the repo at
659 --debug # Enable debug logging
660 --color: string # When to colorize output (always, never, debug, auto)
661 --quiet # Silence non-primary command output
662 --no-pager # Disable the pager
663 --config-toml: string # Additional configuration options (can be repeated)
664 --help(-h) # Print help (see more with '--help')
665 ]
667 # Show information about the local working copy state
668 export extern "jj debug local-working-copy" [
669 --repository(-R): string # Path to repository to operate on
670 --ignore-working-copy # Don't snapshot the working copy, and don't update it
671 --ignore-immutable # Allow rewriting immutable commits
672 --at-operation: string # Operation to load the repo at
673 --at-op: string # Operation to load the repo at
674 --debug # Enable debug logging
675 --color: string # When to colorize output (always, never, debug, auto)
676 --quiet # Silence non-primary command output
677 --no-pager # Disable the pager
678 --config-toml: string # Additional configuration options (can be repeated)
679 --help(-h) # Print help (see more with '--help')
680 ]
682 def "nu-complete jj debug operation display" [] {
683 [ "operation" "id" "view" "all" ]
684 }
686 # Show information about an operation and its view
687 export extern "jj debug operation" [
688 operation?: string
689 --display: string@"nu-complete jj debug operation display"
690 --repository(-R): string # Path to repository to operate on
691 --ignore-working-copy # Don't snapshot the working copy, and don't update it
692 --ignore-immutable # Allow rewriting immutable commits
693 --at-operation: string # Operation to load the repo at
694 --at-op: string # Operation to load the repo at
695 --debug # Enable debug logging
696 --color: string # When to colorize output (always, never, debug, auto)
697 --quiet # Silence non-primary command output
698 --no-pager # Disable the pager
699 --config-toml: string # Additional configuration options (can be repeated)
700 --help(-h) # Print help (see more with '--help')
701 ]
703 # Rebuild commit index
704 export extern "jj debug reindex" [
705 --repository(-R): string # Path to repository to operate on
706 --ignore-working-copy # Don't snapshot the working copy, and don't update it
707 --ignore-immutable # Allow rewriting immutable commits
708 --at-operation: string # Operation to load the repo at
709 --at-op: string # Operation to load the repo at
710 --debug # Enable debug logging
711 --color: string # When to colorize output (always, never, debug, auto)
712 --quiet # Silence non-primary command output
713 --no-pager # Disable the pager
714 --config-toml: string # Additional configuration options (can be repeated)
715 --help(-h) # Print help (see more with '--help')
716 ]
718 # Evaluate revset to full commit IDs
719 export extern "jj debug revset" [
720 revision: string
721 --repository(-R): string # Path to repository to operate on
722 --ignore-working-copy # Don't snapshot the working copy, and don't update it
723 --ignore-immutable # Allow rewriting immutable commits
724 --at-operation: string # Operation to load the repo at
725 --at-op: string # Operation to load the repo at
726 --debug # Enable debug logging
727 --color: string # When to colorize output (always, never, debug, auto)
728 --quiet # Silence non-primary command output
729 --no-pager # Disable the pager
730 --config-toml: string # Additional configuration options (can be repeated)
731 --help(-h) # Print help (see more with '--help')
732 ]
734 # Trigger a snapshot in the op log
735 export extern "jj debug snapshot" [
736 --repository(-R): string # Path to repository to operate on
737 --ignore-working-copy # Don't snapshot the working copy, and don't update it
738 --ignore-immutable # Allow rewriting immutable commits
739 --at-operation: string # Operation to load the repo at
740 --at-op: string # Operation to load the repo at
741 --debug # Enable debug logging
742 --color: string # When to colorize output (always, never, debug, auto)
743 --quiet # Silence non-primary command output
744 --no-pager # Disable the pager
745 --config-toml: string # Additional configuration options (can be repeated)
746 --help(-h) # Print help (see more with '--help')
747 ]
749 # Parse a template
750 export extern "jj debug template" [
751 template: string
752 --repository(-R): string # Path to repository to operate on
753 --ignore-working-copy # Don't snapshot the working copy, and don't update it
754 --ignore-immutable # Allow rewriting immutable commits
755 --at-operation: string # Operation to load the repo at
756 --at-op: string # Operation to load the repo at
757 --debug # Enable debug logging
758 --color: string # When to colorize output (always, never, debug, auto)
759 --quiet # Silence non-primary command output
760 --no-pager # Disable the pager
761 --config-toml: string # Additional configuration options (can be repeated)
762 --help(-h) # Print help (see more with '--help')
763 ]
765 # List the recursive entries of a tree
766 export extern "jj debug tree" [
767 --revision(-r): string
768 --id: string
769 --dir: string
770 ...paths: string
771 --repository(-R): string # Path to repository to operate on
772 --ignore-working-copy # Don't snapshot the working copy, and don't update it
773 --ignore-immutable # Allow rewriting immutable commits
774 --at-operation: string # Operation to load the repo at
775 --at-op: string # Operation to load the repo at
776 --debug # Enable debug logging
777 --color: string # When to colorize output (always, never, debug, auto)
778 --quiet # Silence non-primary command output
779 --no-pager # Disable the pager
780 --config-toml: string # Additional configuration options (can be repeated)
781 --help(-h) # Print help (see more with '--help')
782 ]
784 export extern "jj debug watchman" [
785 --repository(-R): string # Path to repository to operate on
786 --ignore-working-copy # Don't snapshot the working copy, and don't update it
787 --ignore-immutable # Allow rewriting immutable commits
788 --at-operation: string # Operation to load the repo at
789 --at-op: string # Operation to load the repo at
790 --debug # Enable debug logging
791 --color: string # When to colorize output (always, never, debug, auto)
792 --quiet # Silence non-primary command output
793 --no-pager # Disable the pager
794 --config-toml: string # Additional configuration options (can be repeated)
795 --help(-h) # Print help (see more with '--help')
796 ]
798 # Check whether `watchman` is enabled and whether it's correctly installed
799 export extern "jj debug watchman status" [
800 --repository(-R): string # Path to repository to operate on
801 --ignore-working-copy # Don't snapshot the working copy, and don't update it
802 --ignore-immutable # Allow rewriting immutable commits
803 --at-operation: string # Operation to load the repo at
804 --at-op: string # Operation to load the repo at
805 --debug # Enable debug logging
806 --color: string # When to colorize output (always, never, debug, auto)
807 --quiet # Silence non-primary command output
808 --no-pager # Disable the pager
809 --config-toml: string # Additional configuration options (can be repeated)
810 --help(-h) # Print help (see more with '--help')
811 ]
813 export extern "jj debug watchman query-clock" [
814 --repository(-R): string # Path to repository to operate on
815 --ignore-working-copy # Don't snapshot the working copy, and don't update it
816 --ignore-immutable # Allow rewriting immutable commits
817 --at-operation: string # Operation to load the repo at
818 --at-op: string # Operation to load the repo at
819 --debug # Enable debug logging
820 --color: string # When to colorize output (always, never, debug, auto)
821 --quiet # Silence non-primary command output
822 --no-pager # Disable the pager
823 --config-toml: string # Additional configuration options (can be repeated)
824 --help(-h) # Print help (see more with '--help')
825 ]
827 export extern "jj debug watchman query-changed-files" [
828 --repository(-R): string # Path to repository to operate on
829 --ignore-working-copy # Don't snapshot the working copy, and don't update it
830 --ignore-immutable # Allow rewriting immutable commits
831 --at-operation: string # Operation to load the repo at
832 --at-op: string # Operation to load the repo at
833 --debug # Enable debug logging
834 --color: string # When to colorize output (always, never, debug, auto)
835 --quiet # Silence non-primary command output
836 --no-pager # Disable the pager
837 --config-toml: string # Additional configuration options (can be repeated)
838 --help(-h) # Print help (see more with '--help')
839 ]
841 export extern "jj debug watchman reset-clock" [
842 --repository(-R): string # Path to repository to operate on
843 --ignore-working-copy # Don't snapshot the working copy, and don't update it
844 --ignore-immutable # Allow rewriting immutable commits
845 --at-operation: string # Operation to load the repo at
846 --at-op: string # Operation to load the repo at
847 --debug # Enable debug logging
848 --color: string # When to colorize output (always, never, debug, auto)
849 --quiet # Silence non-primary command output
850 --no-pager # Disable the pager
851 --config-toml: string # Additional configuration options (can be repeated)
852 --help(-h) # Print help (see more with '--help')
853 ]
855 # Show information about the working copy state
856 export extern "jj debug working-copy" [
857 --repository(-R): string # Path to repository to operate on
858 --ignore-working-copy # Don't snapshot the working copy, and don't update it
859 --ignore-immutable # Allow rewriting immutable commits
860 --at-operation: string # Operation to load the repo at
861 --at-op: string # Operation to load the repo at
862 --debug # Enable debug logging
863 --color: string # When to colorize output (always, never, debug, auto)
864 --quiet # Silence non-primary command output
865 --no-pager # Disable the pager
866 --config-toml: string # Additional configuration options (can be repeated)
867 --help(-h) # Print help (see more with '--help')
868 ]
870 # Update the change description or other metadata
871 export extern "jj describe" [
872 ...revisions: string # The revision(s) whose description to edit
873 -r # Ignored (but lets you pass `-r` for consistency with other commands)
874 --message(-m): string # The change description to use (don't open editor)
875 --stdin # Read the change description from stdin
876 --no-edit # Don't open an editor
877 --reset-author # Reset the author to the configured user
878 --author: string # Set author to the provided string
879 --repository(-R): string # Path to repository to operate on
880 --ignore-working-copy # Don't snapshot the working copy, and don't update it
881 --ignore-immutable # Allow rewriting immutable commits
882 --at-operation: string # Operation to load the repo at
883 --at-op: string # Operation to load the repo at
884 --debug # Enable debug logging
885 --color: string # When to colorize output (always, never, debug, auto)
886 --quiet # Silence non-primary command output
887 --no-pager # Disable the pager
888 --config-toml: string # Additional configuration options (can be repeated)
889 --help(-h) # Print help (see more with '--help')
890 ]
892 # Compare file contents between two revisions
893 export extern "jj diff" [
894 --revision(-r): string # Show changes in this revision, compared to its parent(s)
895 --from(-f): string # Show changes from this revision
896 --to(-t): string # Show changes to this revision
897 ...paths: string # Restrict the diff to these paths
898 --summary(-s) # For each path, show only whether it was modified, added, or deleted
899 --stat # Show a histogram of the changes
900 --types # For each path, show only its type before and after
901 --name-only # For each path, show only its path
902 --git # Show a Git-format diff
903 --color-words # Show a word-level diff with changes indicated only by color
904 --tool: string # Generate diff by external command
905 --context: string # Number of lines of context to show
906 --ignore-all-space(-w) # Ignore whitespace when comparing lines
907 --ignore-space-change(-b) # Ignore changes in amount of whitespace when comparing lines
908 --repository(-R): string # Path to repository to operate on
909 --ignore-working-copy # Don't snapshot the working copy, and don't update it
910 --ignore-immutable # Allow rewriting immutable commits
911 --at-operation: string # Operation to load the repo at
912 --at-op: string # Operation to load the repo at
913 --debug # Enable debug logging
914 --color: string # When to colorize output (always, never, debug, auto)
915 --quiet # Silence non-primary command output
916 --no-pager # Disable the pager
917 --config-toml: string # Additional configuration options (can be repeated)
918 --help(-h) # Print help (see more with '--help')
919 ]
921 # Touch up the content changes in a revision with a diff editor
922 export extern "jj diffedit" [
923 --revision(-r): string # The revision to touch up
924 --from(-f): string # Show changes from this revision
925 --to(-t): string # Edit changes in this revision
926 --tool: string # Specify diff editor to be used
927 --restore-descendants # Preserve the content (not the diff) when rebasing descendants
928 --repository(-R): string # Path to repository to operate on
929 --ignore-working-copy # Don't snapshot the working copy, and don't update it
930 --ignore-immutable # Allow rewriting immutable commits
931 --at-operation: string # Operation to load the repo at
932 --at-op: string # Operation to load the repo at
933 --debug # Enable debug logging
934 --color: string # When to colorize output (always, never, debug, auto)
935 --quiet # Silence non-primary command output
936 --no-pager # Disable the pager
937 --config-toml: string # Additional configuration options (can be repeated)
938 --help(-h) # Print help (see more with '--help')
939 ]
941 # Create new changes with the same content as existing ones
942 export extern "jj duplicate" [
943 ...revisions_pos: string # The revision(s) to duplicate (default: @)
944 -r: string
945 --destination(-d): string # The revision(s) to duplicate onto (can be repeated to create a merge commit)
946 --insert-after(-A): string # The revision(s) to insert after (can be repeated to create a merge commit)
947 --after: string # The revision(s) to insert after (can be repeated to create a merge commit)
948 --insert-before(-B): string # The revision(s) to insert before (can be repeated to create a merge commit)
949 --before: string # The revision(s) to insert before (can be repeated to create a merge commit)
950 --repository(-R): string # Path to repository to operate on
951 --ignore-working-copy # Don't snapshot the working copy, and don't update it
952 --ignore-immutable # Allow rewriting immutable commits
953 --at-operation: string # Operation to load the repo at
954 --at-op: string # Operation to load the repo at
955 --debug # Enable debug logging
956 --color: string # When to colorize output (always, never, debug, auto)
957 --quiet # Silence non-primary command output
958 --no-pager # Disable the pager
959 --config-toml: string # Additional configuration options (can be repeated)
960 --help(-h) # Print help (see more with '--help')
961 ]
963 # Sets the specified revision as the working-copy revision
964 export extern "jj edit" [
965 revision: string # The commit to edit
966 -r # Ignored (but lets you pass `-r` for consistency with other commands)
967 --repository(-R): string # Path to repository to operate on
968 --ignore-working-copy # Don't snapshot the working copy, and don't update it
969 --ignore-immutable # Allow rewriting immutable commits
970 --at-operation: string # Operation to load the repo at
971 --at-op: string # Operation to load the repo at
972 --debug # Enable debug logging
973 --color: string # When to colorize output (always, never, debug, auto)
974 --quiet # Silence non-primary command output
975 --no-pager # Disable the pager
976 --config-toml: string # Additional configuration options (can be repeated)
977 --help(-h) # Print help (see more with '--help')
978 ]
980 # Show how a change has evolved over time
981 export extern "jj evolog" [
982 --revision(-r): string
983 --limit(-n): string # Limit number of revisions to show
984 -l: string
985 --no-graph # Don't show the graph, show a flat list of revisions
986 --template(-T): string # Render each revision using the given template
987 --patch(-p) # Show patch compared to the previous version of this change
988 --summary(-s) # For each path, show only whether it was modified, added, or deleted
989 --stat # Show a histogram of the changes
990 --types # For each path, show only its type before and after
991 --name-only # For each path, show only its path
992 --git # Show a Git-format diff
993 --color-words # Show a word-level diff with changes indicated only by color
994 --tool: string # Generate diff by external command
995 --context: string # Number of lines of context to show
996 --ignore-all-space # Ignore whitespace when comparing lines
997 --ignore-space-change # Ignore changes in amount of whitespace when comparing lines
998 --repository(-R): string # Path to repository to operate on
999 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1000 --ignore-immutable # Allow rewriting immutable commits
1001 --at-operation: string # Operation to load the repo at
1002 --at-op: string # Operation to load the repo at
1003 --debug # Enable debug logging
1004 --color: string # When to colorize output (always, never, debug, auto)
1005 --quiet # Silence non-primary command output
1006 --no-pager # Disable the pager
1007 --config-toml: string # Additional configuration options (can be repeated)
1008 --help(-h) # Print help (see more with '--help')
1009 ]
1011 # File operations
1012 export extern "jj file" [
1013 --repository(-R): string # Path to repository to operate on
1014 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1015 --ignore-immutable # Allow rewriting immutable commits
1016 --at-operation: string # Operation to load the repo at
1017 --at-op: string # Operation to load the repo at
1018 --debug # Enable debug logging
1019 --color: string # When to colorize output (always, never, debug, auto)
1020 --quiet # Silence non-primary command output
1021 --no-pager # Disable the pager
1022 --config-toml: string # Additional configuration options (can be repeated)
1023 --help(-h) # Print help (see more with '--help')
1024 ]
1026 # Show the source change for each line of the target file
1027 export extern "jj file annotate" [
1028 path: string # the file to annotate
1029 --revision(-r): string # an optional revision to start at
1030 --repository(-R): string # Path to repository to operate on
1031 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1032 --ignore-immutable # Allow rewriting immutable commits
1033 --at-operation: string # Operation to load the repo at
1034 --at-op: string # Operation to load the repo at
1035 --debug # Enable debug logging
1036 --color: string # When to colorize output (always, never, debug, auto)
1037 --quiet # Silence non-primary command output
1038 --no-pager # Disable the pager
1039 --config-toml: string # Additional configuration options (can be repeated)
1040 --help(-h) # Print help (see more with '--help')
1041 ]
1043 def "nu-complete jj file chmod mode" [] {
1044 [ "n" "x" ]
1045 }
1047 # Sets or removes the executable bit for paths in the repo
1048 export extern "jj file chmod" [
1049 mode: string@"nu-complete jj file chmod mode"
1050 --revision(-r): string # The revision to update
1051 ...paths: string # Paths to change the executable bit for
1052 --repository(-R): string # Path to repository to operate on
1053 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1054 --ignore-immutable # Allow rewriting immutable commits
1055 --at-operation: string # Operation to load the repo at
1056 --at-op: string # Operation to load the repo at
1057 --debug # Enable debug logging
1058 --color: string # When to colorize output (always, never, debug, auto)
1059 --quiet # Silence non-primary command output
1060 --no-pager # Disable the pager
1061 --config-toml: string # Additional configuration options (can be repeated)
1062 --help(-h) # Print help (see more with '--help')
1063 ]
1065 # List files in a revision
1066 export extern "jj file list" [
1067 --revision(-r): string # The revision to list files in
1068 ...paths: string # Only list files matching these prefixes (instead of all files)
1069 --repository(-R): string # Path to repository to operate on
1070 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1071 --ignore-immutable # Allow rewriting immutable commits
1072 --at-operation: string # Operation to load the repo at
1073 --at-op: string # Operation to load the repo at
1074 --debug # Enable debug logging
1075 --color: string # When to colorize output (always, never, debug, auto)
1076 --quiet # Silence non-primary command output
1077 --no-pager # Disable the pager
1078 --config-toml: string # Additional configuration options (can be repeated)
1079 --help(-h) # Print help (see more with '--help')
1080 ]
1082 # Print contents of files in a revision
1083 export extern "jj file show" [
1084 --revision(-r): string # The revision to get the file contents from
1085 ...paths: string # Paths to print
1086 --repository(-R): string # Path to repository to operate on
1087 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1088 --ignore-immutable # Allow rewriting immutable commits
1089 --at-operation: string # Operation to load the repo at
1090 --at-op: string # Operation to load the repo at
1091 --debug # Enable debug logging
1092 --color: string # When to colorize output (always, never, debug, auto)
1093 --quiet # Silence non-primary command output
1094 --no-pager # Disable the pager
1095 --config-toml: string # Additional configuration options (can be repeated)
1096 --help(-h) # Print help (see more with '--help')
1097 ]
1099 # Start tracking specified paths in the working copy
1100 export extern "jj file track" [
1101 ...paths: string # Paths to track
1102 --repository(-R): string # Path to repository to operate on
1103 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1104 --ignore-immutable # Allow rewriting immutable commits
1105 --at-operation: string # Operation to load the repo at
1106 --at-op: string # Operation to load the repo at
1107 --debug # Enable debug logging
1108 --color: string # When to colorize output (always, never, debug, auto)
1109 --quiet # Silence non-primary command output
1110 --no-pager # Disable the pager
1111 --config-toml: string # Additional configuration options (can be repeated)
1112 --help(-h) # Print help (see more with '--help')
1113 ]
1115 # Stop tracking specified paths in the working copy
1116 export extern "jj file untrack" [
1117 ...paths: string # Paths to untrack. They must already be ignored
1118 --repository(-R): string # Path to repository to operate on
1119 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1120 --ignore-immutable # Allow rewriting immutable commits
1121 --at-operation: string # Operation to load the repo at
1122 --at-op: string # Operation to load the repo at
1123 --debug # Enable debug logging
1124 --color: string # When to colorize output (always, never, debug, auto)
1125 --quiet # Silence non-primary command output
1126 --no-pager # Disable the pager
1127 --config-toml: string # Additional configuration options (can be repeated)
1128 --help(-h) # Print help (see more with '--help')
1129 ]
1131 # List files in a revision (DEPRECATED use `jj file list`)
1132 export extern "jj files" [
1133 --revision(-r): string # The revision to list files in
1134 ...paths: string # Only list files matching these prefixes (instead of all files)
1135 --repository(-R): string # Path to repository to operate on
1136 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1137 --ignore-immutable # Allow rewriting immutable commits
1138 --at-operation: string # Operation to load the repo at
1139 --at-op: string # Operation to load the repo at
1140 --debug # Enable debug logging
1141 --color: string # When to colorize output (always, never, debug, auto)
1142 --quiet # Silence non-primary command output
1143 --no-pager # Disable the pager
1144 --config-toml: string # Additional configuration options (can be repeated)
1145 --help(-h) # Print help (see more with '--help')
1146 ]
1148 # Update files with formatting fixes or other changes
1149 export extern "jj fix" [
1150 --source(-s): string # Fix files in the specified revision(s) and their descendants. If no revisions are specified, this defaults to the `revsets.fix` setting, or `reachable(@, mutable())` if it is not set
1151 ...paths: string # Fix only these paths
1152 --include-unchanged-files # Fix unchanged files in addition to changed ones. If no paths are specified, all files in the repo will be fixed
1153 --repository(-R): string # Path to repository to operate on
1154 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1155 --ignore-immutable # Allow rewriting immutable commits
1156 --at-operation: string # Operation to load the repo at
1157 --at-op: string # Operation to load the repo at
1158 --debug # Enable debug logging
1159 --color: string # When to colorize output (always, never, debug, auto)
1160 --quiet # Silence non-primary command output
1161 --no-pager # Disable the pager
1162 --config-toml: string # Additional configuration options (can be repeated)
1163 --help(-h) # Print help (see more with '--help')
1164 ]
1166 # Commands for working with Git remotes and the underlying Git repo
1167 export extern "jj git" [
1168 --repository(-R): string # Path to repository to operate on
1169 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1170 --ignore-immutable # Allow rewriting immutable commits
1171 --at-operation: string # Operation to load the repo at
1172 --at-op: string # Operation to load the repo at
1173 --debug # Enable debug logging
1174 --color: string # When to colorize output (always, never, debug, auto)
1175 --quiet # Silence non-primary command output
1176 --no-pager # Disable the pager
1177 --config-toml: string # Additional configuration options (can be repeated)
1178 --help(-h) # Print help (see more with '--help')
1179 ]
1181 # Create a new repo backed by a clone of a Git repo
1182 export extern "jj git clone" [
1183 source: string # URL or path of the Git repo to clone
1184 destination?: string # Specifies the target directory for the Jujutsu repository clone. If not provided, defaults to a directory named after the last component of the source URL. The full directory path will be created if it doesn't exist
1185 --remote: string # Name of the newly created remote
1186 --colocate # Whether or not to colocate the Jujutsu repo with the git repo
1187 --depth: string # Create a shallow clone of the given depth
1188 --repository(-R): string # Path to repository to operate on
1189 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1190 --ignore-immutable # Allow rewriting immutable commits
1191 --at-operation: string # Operation to load the repo at
1192 --at-op: string # Operation to load the repo at
1193 --debug # Enable debug logging
1194 --color: string # When to colorize output (always, never, debug, auto)
1195 --quiet # Silence non-primary command output
1196 --no-pager # Disable the pager
1197 --config-toml: string # Additional configuration options (can be repeated)
1198 --help(-h) # Print help (see more with '--help')
1199 ]
1201 # Update the underlying Git repo with changes made in the repo
1202 export extern "jj git export" [
1203 --repository(-R): string # Path to repository to operate on
1204 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1205 --ignore-immutable # Allow rewriting immutable commits
1206 --at-operation: string # Operation to load the repo at
1207 --at-op: string # Operation to load the repo at
1208 --debug # Enable debug logging
1209 --color: string # When to colorize output (always, never, debug, auto)
1210 --quiet # Silence non-primary command output
1211 --no-pager # Disable the pager
1212 --config-toml: string # Additional configuration options (can be repeated)
1213 --help(-h) # Print help (see more with '--help')
1214 ]
1216 # Fetch from a Git remote
1217 export extern "jj git fetch" [
1218 --branch(-b): string # Fetch only some of the branches
1219 --remote: string # The remote to fetch from (only named remotes are supported, can be repeated)
1220 --all-remotes # Fetch from all remotes
1221 --repository(-R): string # Path to repository to operate on
1222 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1223 --ignore-immutable # Allow rewriting immutable commits
1224 --at-operation: string # Operation to load the repo at
1225 --at-op: string # Operation to load the repo at
1226 --debug # Enable debug logging
1227 --color: string # When to colorize output (always, never, debug, auto)
1228 --quiet # Silence non-primary command output
1229 --no-pager # Disable the pager
1230 --config-toml: string # Additional configuration options (can be repeated)
1231 --help(-h) # Print help (see more with '--help')
1232 ]
1234 # Update repo with changes made in the underlying Git repo
1235 export extern "jj git import" [
1236 --repository(-R): string # Path to repository to operate on
1237 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1238 --ignore-immutable # Allow rewriting immutable commits
1239 --at-operation: string # Operation to load the repo at
1240 --at-op: string # Operation to load the repo at
1241 --debug # Enable debug logging
1242 --color: string # When to colorize output (always, never, debug, auto)
1243 --quiet # Silence non-primary command output
1244 --no-pager # Disable the pager
1245 --config-toml: string # Additional configuration options (can be repeated)
1246 --help(-h) # Print help (see more with '--help')
1247 ]
1249 # Create a new Git backed repo
1250 export extern "jj git init" [
1251 destination?: string # The destination directory where the `jj` repo will be created. If the directory does not exist, it will be created. If no directory is given, the current directory is used
1252 --colocate # Specifies that the `jj` repo should also be a valid `git` repo, allowing the use of both `jj` and `git` commands in the same directory
1253 --git-repo: string # Specifies a path to an **existing** git repository to be used as the backing git repo for the newly created `jj` repo
1254 --repository(-R): string # Path to repository to operate on
1255 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1256 --ignore-immutable # Allow rewriting immutable commits
1257 --at-operation: string # Operation to load the repo at
1258 --at-op: string # Operation to load the repo at
1259 --debug # Enable debug logging
1260 --color: string # When to colorize output (always, never, debug, auto)
1261 --quiet # Silence non-primary command output
1262 --no-pager # Disable the pager
1263 --config-toml: string # Additional configuration options (can be repeated)
1264 --help(-h) # Print help (see more with '--help')
1265 ]
1267 # Push to a Git remote
1268 export extern "jj git push" [
1269 --remote: string # The remote to push to (only named remotes are supported)
1270 --bookmark(-b): string # Push only this bookmark, or bookmarks matching a pattern (can be repeated)
1271 --all # Push all bookmarks (including new and deleted bookmarks)
1272 --tracked # Push all tracked bookmarks (including deleted bookmarks)
1273 --deleted # Push all deleted bookmarks
1274 --allow-new(-N) # Allow pushing new bookmarks
1275 --allow-empty-description # Allow pushing commits with empty descriptions
1276 --allow-private # Allow pushing commits that are private
1277 --revisions(-r): string # Push bookmarks pointing to these commits (can be repeated)
1278 --change(-c): string # Push this commit by creating a bookmark based on its change ID (can be repeated)
1279 --dry-run # Only display what will change on the remote
1280 --repository(-R): string # Path to repository to operate on
1281 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1282 --ignore-immutable # Allow rewriting immutable commits
1283 --at-operation: string # Operation to load the repo at
1284 --at-op: string # Operation to load the repo at
1285 --debug # Enable debug logging
1286 --color: string # When to colorize output (always, never, debug, auto)
1287 --quiet # Silence non-primary command output
1288 --no-pager # Disable the pager
1289 --config-toml: string # Additional configuration options (can be repeated)
1290 --help(-h) # Print help (see more with '--help')
1291 ]
1293 # Manage Git remotes
1294 export extern "jj git remote" [
1295 --repository(-R): string # Path to repository to operate on
1296 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1297 --ignore-immutable # Allow rewriting immutable commits
1298 --at-operation: string # Operation to load the repo at
1299 --at-op: string # Operation to load the repo at
1300 --debug # Enable debug logging
1301 --color: string # When to colorize output (always, never, debug, auto)
1302 --quiet # Silence non-primary command output
1303 --no-pager # Disable the pager
1304 --config-toml: string # Additional configuration options (can be repeated)
1305 --help(-h) # Print help (see more with '--help')
1306 ]
1308 # Add a Git remote
1309 export extern "jj git remote add" [
1310 remote: string # The remote's name
1311 url: string # The remote's URL
1312 --repository(-R): string # Path to repository to operate on
1313 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1314 --ignore-immutable # Allow rewriting immutable commits
1315 --at-operation: string # Operation to load the repo at
1316 --at-op: string # Operation to load the repo at
1317 --debug # Enable debug logging
1318 --color: string # When to colorize output (always, never, debug, auto)
1319 --quiet # Silence non-primary command output
1320 --no-pager # Disable the pager
1321 --config-toml: string # Additional configuration options (can be repeated)
1322 --help(-h) # Print help (see more with '--help')
1323 ]
1325 # List Git remotes
1326 export extern "jj git remote list" [
1327 --repository(-R): string # Path to repository to operate on
1328 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1329 --ignore-immutable # Allow rewriting immutable commits
1330 --at-operation: string # Operation to load the repo at
1331 --at-op: string # Operation to load the repo at
1332 --debug # Enable debug logging
1333 --color: string # When to colorize output (always, never, debug, auto)
1334 --quiet # Silence non-primary command output
1335 --no-pager # Disable the pager
1336 --config-toml: string # Additional configuration options (can be repeated)
1337 --help(-h) # Print help (see more with '--help')
1338 ]
1340 # Remove a Git remote and forget its bookmarks
1341 export extern "jj git remote remove" [
1342 remote: string # The remote's name
1343 --repository(-R): string # Path to repository to operate on
1344 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1345 --ignore-immutable # Allow rewriting immutable commits
1346 --at-operation: string # Operation to load the repo at
1347 --at-op: string # Operation to load the repo at
1348 --debug # Enable debug logging
1349 --color: string # When to colorize output (always, never, debug, auto)
1350 --quiet # Silence non-primary command output
1351 --no-pager # Disable the pager
1352 --config-toml: string # Additional configuration options (can be repeated)
1353 --help(-h) # Print help (see more with '--help')
1354 ]
1356 # Rename a Git remote
1357 export extern "jj git remote rename" [
1358 old: string # The name of an existing remote
1359 new: string # The desired name for `old`
1360 --repository(-R): string # Path to repository to operate on
1361 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1362 --ignore-immutable # Allow rewriting immutable commits
1363 --at-operation: string # Operation to load the repo at
1364 --at-op: string # Operation to load the repo at
1365 --debug # Enable debug logging
1366 --color: string # When to colorize output (always, never, debug, auto)
1367 --quiet # Silence non-primary command output
1368 --no-pager # Disable the pager
1369 --config-toml: string # Additional configuration options (can be repeated)
1370 --help(-h) # Print help (see more with '--help')
1371 ]
1373 # Set the URL of a Git remote
1374 export extern "jj git remote set-url" [
1375 remote: string # The remote's name
1376 url: string # The desired url for `remote`
1377 --repository(-R): string # Path to repository to operate on
1378 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1379 --ignore-immutable # Allow rewriting immutable commits
1380 --at-operation: string # Operation to load the repo at
1381 --at-op: string # Operation to load the repo at
1382 --debug # Enable debug logging
1383 --color: string # When to colorize output (always, never, debug, auto)
1384 --quiet # Silence non-primary command output
1385 --no-pager # Disable the pager
1386 --config-toml: string # Additional configuration options (can be repeated)
1387 --help(-h) # Print help (see more with '--help')
1388 ]
1390 # FOR INTERNAL USE ONLY Interact with git submodules
1391 export extern "jj git submodule" [
1392 --repository(-R): string # Path to repository to operate on
1393 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1394 --ignore-immutable # Allow rewriting immutable commits
1395 --at-operation: string # Operation to load the repo at
1396 --at-op: string # Operation to load the repo at
1397 --debug # Enable debug logging
1398 --color: string # When to colorize output (always, never, debug, auto)
1399 --quiet # Silence non-primary command output
1400 --no-pager # Disable the pager
1401 --config-toml: string # Additional configuration options (can be repeated)
1402 --help(-h) # Print help (see more with '--help')
1403 ]
1405 # Print the relevant contents from .gitmodules. For debugging purposes only
1406 export extern "jj git submodule print-gitmodules" [
1407 --revisions(-r): string # Read .gitmodules from the given revision
1408 --repository(-R): string # Path to repository to operate on
1409 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1410 --ignore-immutable # Allow rewriting immutable commits
1411 --at-operation: string # Operation to load the repo at
1412 --at-op: string # Operation to load the repo at
1413 --debug # Enable debug logging
1414 --color: string # When to colorize output (always, never, debug, auto)
1415 --quiet # Silence non-primary command output
1416 --no-pager # Disable the pager
1417 --config-toml: string # Additional configuration options (can be repeated)
1418 --help(-h) # Print help (see more with '--help')
1419 ]
1421 def "nu-complete jj help keyword" [] {
1422 [ "revsets" "tutorial" ]
1423 }
1425 # Print this message or the help of the given subcommand(s)
1426 export extern "jj help" [
1427 ...command: string # Print help for the subcommand(s)
1428 --keyword(-k): string@"nu-complete jj help keyword" # Show help for keywords instead of commands
1429 --repository(-R): string # Path to repository to operate on
1430 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1431 --ignore-immutable # Allow rewriting immutable commits
1432 --at-operation: string # Operation to load the repo at
1433 --at-op: string # Operation to load the repo at
1434 --debug # Enable debug logging
1435 --color: string # When to colorize output (always, never, debug, auto)
1436 --quiet # Silence non-primary command output
1437 --no-pager # Disable the pager
1438 --config-toml: string # Additional configuration options (can be repeated)
1439 --help(-h) # Print help (see more with '--help')
1440 ]
1442 # Create a new repo in the given directory
1443 export extern "jj init" [
1444 destination?: string # The destination directory
1445 --git # DEPRECATED: Use `jj git init` Use the Git backend, creating a jj repo backed by a Git repo
1446 --git-repo: string # DEPRECATED: Use `jj git init` Path to a git repo the jj repo will be backed by
1447 --repository(-R): string # Path to repository to operate on
1448 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1449 --ignore-immutable # Allow rewriting immutable commits
1450 --at-operation: string # Operation to load the repo at
1451 --at-op: string # Operation to load the repo at
1452 --debug # Enable debug logging
1453 --color: string # When to colorize output (always, never, debug, auto)
1454 --quiet # Silence non-primary command output
1455 --no-pager # Disable the pager
1456 --config-toml: string # Additional configuration options (can be repeated)
1457 --help(-h) # Print help (see more with '--help')
1458 ]
1460 # Compare the changes of two commits
1461 export extern "jj interdiff" [
1462 --from(-f): string # Show changes from this revision
1463 --to(-t): string # Show changes to this revision
1464 ...paths: string # Restrict the diff to these paths
1465 --summary(-s) # For each path, show only whether it was modified, added, or deleted
1466 --stat # Show a histogram of the changes
1467 --types # For each path, show only its type before and after
1468 --name-only # For each path, show only its path
1469 --git # Show a Git-format diff
1470 --color-words # Show a word-level diff with changes indicated only by color
1471 --tool: string # Generate diff by external command
1472 --context: string # Number of lines of context to show
1473 --ignore-all-space(-w) # Ignore whitespace when comparing lines
1474 --ignore-space-change(-b) # Ignore changes in amount of whitespace when comparing lines
1475 --repository(-R): string # Path to repository to operate on
1476 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1477 --ignore-immutable # Allow rewriting immutable commits
1478 --at-operation: string # Operation to load the repo at
1479 --at-op: string # Operation to load the repo at
1480 --debug # Enable debug logging
1481 --color: string # When to colorize output (always, never, debug, auto)
1482 --quiet # Silence non-primary command output
1483 --no-pager # Disable the pager
1484 --config-toml: string # Additional configuration options (can be repeated)
1485 --help(-h) # Print help (see more with '--help')
1486 ]
1488 # Show revision history
1489 export extern "jj log" [
1490 --revisions(-r): string # Which revisions to show
1491 ...paths: string # Show revisions modifying the given paths
1492 --reversed # Show revisions in the opposite order (older revisions first)
1493 --limit(-n): string # Limit number of revisions to show
1494 -l: string
1495 --no-graph # Don't show the graph, show a flat list of revisions
1496 --template(-T): string # Render each revision using the given template
1497 --patch(-p) # Show patch
1498 --summary(-s) # For each path, show only whether it was modified, added, or deleted
1499 --stat # Show a histogram of the changes
1500 --types # For each path, show only its type before and after
1501 --name-only # For each path, show only its path
1502 --git # Show a Git-format diff
1503 --color-words # Show a word-level diff with changes indicated only by color
1504 --tool: string # Generate diff by external command
1505 --context: string # Number of lines of context to show
1506 --ignore-all-space # Ignore whitespace when comparing lines
1507 --ignore-space-change # Ignore changes in amount of whitespace when comparing lines
1508 --repository(-R): string # Path to repository to operate on
1509 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1510 --ignore-immutable # Allow rewriting immutable commits
1511 --at-operation: string # Operation to load the repo at
1512 --at-op: string # Operation to load the repo at
1513 --debug # Enable debug logging
1514 --color: string # When to colorize output (always, never, debug, auto)
1515 --quiet # Silence non-primary command output
1516 --no-pager # Disable the pager
1517 --config-toml: string # Additional configuration options (can be repeated)
1518 --help(-h) # Print help (see more with '--help')
1519 ]
1521 # Create a new, empty change and (by default) edit it in the working copy
1522 export extern "jj new" [
1523 ...revisions: string # Parent(s) of the new change
1524 -d # Ignored (but lets you pass `-d`/`-r` for consistency with other commands)
1525 --message(-m): string # The change description to use
1526 --no-edit # Do not edit the newly created change
1527 --edit # No-op flag to pair with --no-edit
1528 --insert-after(-A): string # Insert the new change after the given commit(s)
1529 --after: string # Insert the new change after the given commit(s)
1530 --insert-before(-B): string # Insert the new change before the given commit(s)
1531 --before: string # Insert the new change before the given commit(s)
1532 --repository(-R): string # Path to repository to operate on
1533 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1534 --ignore-immutable # Allow rewriting immutable commits
1535 --at-operation: string # Operation to load the repo at
1536 --at-op: string # Operation to load the repo at
1537 --debug # Enable debug logging
1538 --color: string # When to colorize output (always, never, debug, auto)
1539 --quiet # Silence non-primary command output
1540 --no-pager # Disable the pager
1541 --config-toml: string # Additional configuration options (can be repeated)
1542 --help(-h) # Print help (see more with '--help')
1543 ]
1545 # Move the working-copy commit to the child revision
1546 export extern "jj next" [
1547 offset?: string # How many revisions to move forward. Advances to the next child by default
1548 --edit(-e) # Instead of creating a new working-copy commit on top of the target commit (like `jj new`), edit the target commit directly (like `jj edit`)
1549 --no-edit(-n) # The inverse of `--edit`
1550 --conflict # Jump to the next conflicted descendant
1551 --repository(-R): string # Path to repository to operate on
1552 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1553 --ignore-immutable # Allow rewriting immutable commits
1554 --at-operation: string # Operation to load the repo at
1555 --at-op: string # Operation to load the repo at
1556 --debug # Enable debug logging
1557 --color: string # When to colorize output (always, never, debug, auto)
1558 --quiet # Silence non-primary command output
1559 --no-pager # Disable the pager
1560 --config-toml: string # Additional configuration options (can be repeated)
1561 --help(-h) # Print help (see more with '--help')
1562 ]
1564 # Commands for working with the operation log
1565 export extern "jj operation" [
1566 --repository(-R): string # Path to repository to operate on
1567 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1568 --ignore-immutable # Allow rewriting immutable commits
1569 --at-operation: string # Operation to load the repo at
1570 --at-op: string # Operation to load the repo at
1571 --debug # Enable debug logging
1572 --color: string # When to colorize output (always, never, debug, auto)
1573 --quiet # Silence non-primary command output
1574 --no-pager # Disable the pager
1575 --config-toml: string # Additional configuration options (can be repeated)
1576 --help(-h) # Print help (see more with '--help')
1577 ]
1579 # Abandon operation history
1580 export extern "jj operation abandon" [
1581 operation: string # The operation or operation range to abandon
1582 --repository(-R): string # Path to repository to operate on
1583 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1584 --ignore-immutable # Allow rewriting immutable commits
1585 --at-operation: string # Operation to load the repo at
1586 --at-op: string # Operation to load the repo at
1587 --debug # Enable debug logging
1588 --color: string # When to colorize output (always, never, debug, auto)
1589 --quiet # Silence non-primary command output
1590 --no-pager # Disable the pager
1591 --config-toml: string # Additional configuration options (can be repeated)
1592 --help(-h) # Print help (see more with '--help')
1593 ]
1595 # Compare changes to the repository between two operations
1596 export extern "jj operation diff" [
1597 --operation: string # Show repository changes in this operation, compared to its parent
1598 --op: string # Show repository changes in this operation, compared to its parent
1599 --from(-f): string # Show repository changes from this operation
1600 --to(-t): string # Show repository changes to this operation
1601 --no-graph # Don't show the graph, show a flat list of modified changes
1602 --patch(-p) # Show patch of modifications to changes
1603 --summary(-s) # For each path, show only whether it was modified, added, or deleted
1604 --stat # Show a histogram of the changes
1605 --types # For each path, show only its type before and after
1606 --name-only # For each path, show only its path
1607 --git # Show a Git-format diff
1608 --color-words # Show a word-level diff with changes indicated only by color
1609 --tool: string # Generate diff by external command
1610 --context: string # Number of lines of context to show
1611 --ignore-all-space # Ignore whitespace when comparing lines
1612 --ignore-space-change # Ignore changes in amount of whitespace when comparing lines
1613 --repository(-R): string # Path to repository to operate on
1614 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1615 --ignore-immutable # Allow rewriting immutable commits
1616 --at-operation: string # Operation to load the repo at
1617 --at-op: string # Operation to load the repo at
1618 --debug # Enable debug logging
1619 --color: string # When to colorize output (always, never, debug, auto)
1620 --quiet # Silence non-primary command output
1621 --no-pager # Disable the pager
1622 --config-toml: string # Additional configuration options (can be repeated)
1623 --help(-h) # Print help (see more with '--help')
1624 ]
1626 # Show the operation log
1627 export extern "jj operation log" [
1628 --limit(-n): string # Limit number of operations to show
1629 -l: string
1630 --no-graph # Don't show the graph, show a flat list of operations
1631 --template(-T): string # Render each operation using the given template
1632 --op-diff # Show changes to the repository at each operation
1633 --patch(-p) # Show patch of modifications to changes (implies --op-diff)
1634 --summary(-s) # For each path, show only whether it was modified, added, or deleted
1635 --stat # Show a histogram of the changes
1636 --types # For each path, show only its type before and after
1637 --name-only # For each path, show only its path
1638 --git # Show a Git-format diff
1639 --color-words # Show a word-level diff with changes indicated only by color
1640 --tool: string # Generate diff by external command
1641 --context: string # Number of lines of context to show
1642 --ignore-all-space # Ignore whitespace when comparing lines
1643 --ignore-space-change # Ignore changes in amount of whitespace when comparing lines
1644 --repository(-R): string # Path to repository to operate on
1645 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1646 --ignore-immutable # Allow rewriting immutable commits
1647 --at-operation: string # Operation to load the repo at
1648 --at-op: string # Operation to load the repo at
1649 --debug # Enable debug logging
1650 --color: string # When to colorize output (always, never, debug, auto)
1651 --quiet # Silence non-primary command output
1652 --no-pager # Disable the pager
1653 --config-toml: string # Additional configuration options (can be repeated)
1654 --help(-h) # Print help (see more with '--help')
1655 ]
1657 def "nu-complete jj operation restore what" [] {
1658 [ "repo" "remote-tracking" ]
1659 }
1661 # Create a new operation that restores the repo to an earlier state
1662 export extern "jj operation restore" [
1663 operation: string # The operation to restore to
1664 --what: string@"nu-complete jj operation restore what" # What portions of the local state to restore (can be repeated)
1665 --repository(-R): string # Path to repository to operate on
1666 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1667 --ignore-immutable # Allow rewriting immutable commits
1668 --at-operation: string # Operation to load the repo at
1669 --at-op: string # Operation to load the repo at
1670 --debug # Enable debug logging
1671 --color: string # When to colorize output (always, never, debug, auto)
1672 --quiet # Silence non-primary command output
1673 --no-pager # Disable the pager
1674 --config-toml: string # Additional configuration options (can be repeated)
1675 --help(-h) # Print help (see more with '--help')
1676 ]
1678 # Show changes to the repository in an operation
1679 export extern "jj operation show" [
1680 operation?: string # Show repository changes in this operation, compared to its parent(s)
1681 --no-graph # Don't show the graph, show a flat list of modified changes
1682 --patch(-p) # Show patch of modifications to changes
1683 --summary(-s) # For each path, show only whether it was modified, added, or deleted
1684 --stat # Show a histogram of the changes
1685 --types # For each path, show only its type before and after
1686 --name-only # For each path, show only its path
1687 --git # Show a Git-format diff
1688 --color-words # Show a word-level diff with changes indicated only by color
1689 --tool: string # Generate diff by external command
1690 --context: string # Number of lines of context to show
1691 --ignore-all-space # Ignore whitespace when comparing lines
1692 --ignore-space-change # Ignore changes in amount of whitespace when comparing lines
1693 --repository(-R): string # Path to repository to operate on
1694 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1695 --ignore-immutable # Allow rewriting immutable commits
1696 --at-operation: string # Operation to load the repo at
1697 --at-op: string # Operation to load the repo at
1698 --debug # Enable debug logging
1699 --color: string # When to colorize output (always, never, debug, auto)
1700 --quiet # Silence non-primary command output
1701 --no-pager # Disable the pager
1702 --config-toml: string # Additional configuration options (can be repeated)
1703 --help(-h) # Print help (see more with '--help')
1704 ]
1706 def "nu-complete jj operation undo what" [] {
1707 [ "repo" "remote-tracking" ]
1708 }
1710 # Create a new operation that undoes an earlier operation
1711 export extern "jj operation undo" [
1712 operation?: string # The operation to undo
1713 --what: string@"nu-complete jj operation undo what" # What portions of the local state to restore (can be repeated)
1714 --repository(-R): string # Path to repository to operate on
1715 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1716 --ignore-immutable # Allow rewriting immutable commits
1717 --at-operation: string # Operation to load the repo at
1718 --at-op: string # Operation to load the repo at
1719 --debug # Enable debug logging
1720 --color: string # When to colorize output (always, never, debug, auto)
1721 --quiet # Silence non-primary command output
1722 --no-pager # Disable the pager
1723 --config-toml: string # Additional configuration options (can be repeated)
1724 --help(-h) # Print help (see more with '--help')
1725 ]
1727 # Parallelize revisions by making them siblings
1728 export extern "jj parallelize" [
1729 ...revisions: string # Revisions to parallelize
1730 --repository(-R): string # Path to repository to operate on
1731 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1732 --ignore-immutable # Allow rewriting immutable commits
1733 --at-operation: string # Operation to load the repo at
1734 --at-op: string # Operation to load the repo at
1735 --debug # Enable debug logging
1736 --color: string # When to colorize output (always, never, debug, auto)
1737 --quiet # Silence non-primary command output
1738 --no-pager # Disable the pager
1739 --config-toml: string # Additional configuration options (can be repeated)
1740 --help(-h) # Print help (see more with '--help')
1741 ]
1743 # Change the working copy revision relative to the parent revision
1744 export extern "jj prev" [
1745 offset?: string # How many revisions to move backward. Moves to the parent by default
1746 --edit(-e) # Edit the parent directly, instead of moving the working-copy commit
1747 --no-edit(-n) # The inverse of `--edit`
1748 --conflict # Jump to the previous conflicted ancestor
1749 --repository(-R): string # Path to repository to operate on
1750 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1751 --ignore-immutable # Allow rewriting immutable commits
1752 --at-operation: string # Operation to load the repo at
1753 --at-op: string # Operation to load the repo at
1754 --debug # Enable debug logging
1755 --color: string # When to colorize output (always, never, debug, auto)
1756 --quiet # Silence non-primary command output
1757 --no-pager # Disable the pager
1758 --config-toml: string # Additional configuration options (can be repeated)
1759 --help(-h) # Print help (see more with '--help')
1760 ]
1762 # Move revisions to different parent(s)
1763 export extern "jj rebase" [
1764 --branch(-b): string # Rebase the whole branch relative to destination's ancestors (can be repeated)
1765 --source(-s): string # Rebase specified revision(s) together with their trees of descendants (can be repeated)
1766 --revisions(-r): string # Rebase the given revisions, rebasing descendants onto this revision's parent(s)
1767 --destination(-d): string # The revision(s) to rebase onto (can be repeated to create a merge commit)
1768 --insert-after(-A): string # The revision(s) to insert after (can be repeated to create a merge commit)
1769 --after: string # The revision(s) to insert after (can be repeated to create a merge commit)
1770 --insert-before(-B): string # The revision(s) to insert before (can be repeated to create a merge commit)
1771 --before: string # The revision(s) to insert before (can be repeated to create a merge commit)
1772 --skip-empty # Deprecated. Use --skip-emptied instead
1773 --skip-emptied # If true, when rebasing would produce an empty commit, the commit is abandoned. It will not be abandoned if it was already empty before the rebase. Will never skip merge commits with multiple non-empty parents
1774 --repository(-R): string # Path to repository to operate on
1775 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1776 --ignore-immutable # Allow rewriting immutable commits
1777 --at-operation: string # Operation to load the repo at
1778 --at-op: string # Operation to load the repo at
1779 --debug # Enable debug logging
1780 --color: string # When to colorize output (always, never, debug, auto)
1781 --quiet # Silence non-primary command output
1782 --no-pager # Disable the pager
1783 --config-toml: string # Additional configuration options (can be repeated)
1784 --help(-h) # Print help (see more with '--help')
1785 ]
1787 # Resolve a conflicted file with an external merge tool
1788 export extern "jj resolve" [
1789 --revision(-r): string
1790 --list(-l) # Instead of resolving one conflict, list all the conflicts
1791 --tool: string # Specify 3-way merge tool to be used
1792 ...paths: string # Restrict to these paths when searching for a conflict to resolve. We will attempt to resolve the first conflict we can find. You can use the `--list` argument to find paths to use here
1793 --repository(-R): string # Path to repository to operate on
1794 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1795 --ignore-immutable # Allow rewriting immutable commits
1796 --at-operation: string # Operation to load the repo at
1797 --at-op: string # Operation to load the repo at
1798 --debug # Enable debug logging
1799 --color: string # When to colorize output (always, never, debug, auto)
1800 --quiet # Silence non-primary command output
1801 --no-pager # Disable the pager
1802 --config-toml: string # Additional configuration options (can be repeated)
1803 --help(-h) # Print help (see more with '--help')
1804 ]
1806 # Restore paths from another revision
1807 export extern "jj restore" [
1808 ...paths: string # Restore only these paths (instead of all paths)
1809 --from(-f): string # Revision to restore from (source)
1810 --to(-t): string # Revision to restore into (destination)
1811 --changes-in(-c): string # Undo the changes in a revision as compared to the merge of its parents
1812 --revision(-r): string # Prints an error. DO NOT USE
1813 --restore-descendants # Preserve the content (not the diff) when rebasing descendants
1814 --repository(-R): string # Path to repository to operate on
1815 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1816 --ignore-immutable # Allow rewriting immutable commits
1817 --at-operation: string # Operation to load the repo at
1818 --at-op: string # Operation to load the repo at
1819 --debug # Enable debug logging
1820 --color: string # When to colorize output (always, never, debug, auto)
1821 --quiet # Silence non-primary command output
1822 --no-pager # Disable the pager
1823 --config-toml: string # Additional configuration options (can be repeated)
1824 --help(-h) # Print help (see more with '--help')
1825 ]
1827 # A dummy command that accepts any arguments
1828 export extern "jj revert" [
1829 ..._args: string
1830 --repository(-R): string # Path to repository to operate on
1831 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1832 --ignore-immutable # Allow rewriting immutable commits
1833 --at-operation: string # Operation to load the repo at
1834 --at-op: string # Operation to load the repo at
1835 --debug # Enable debug logging
1836 --color: string # When to colorize output (always, never, debug, auto)
1837 --quiet # Silence non-primary command output
1838 --no-pager # Disable the pager
1839 --config-toml: string # Additional configuration options (can be repeated)
1840 --help(-h) # Print help (see more with '--help')
1841 ]
1843 # Show the current workspace root directory
1844 export extern "jj root" [
1845 --repository(-R): string # Path to repository to operate on
1846 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1847 --ignore-immutable # Allow rewriting immutable commits
1848 --at-operation: string # Operation to load the repo at
1849 --at-op: string # Operation to load the repo at
1850 --debug # Enable debug logging
1851 --color: string # When to colorize output (always, never, debug, auto)
1852 --quiet # Silence non-primary command output
1853 --no-pager # Disable the pager
1854 --config-toml: string # Additional configuration options (can be repeated)
1855 --help(-h) # Print help (see more with '--help')
1856 ]
1858 # (**Stub**, does not work yet) Run a command across a set of revisions.
1859 export extern "jj run" [
1860 shell_command: string # The command to run across all selected revisions
1861 --revisions(-r): string # The revisions to change
1862 -x # A no-op option to match the interface of `git rebase -x`
1863 --jobs(-j): string # How many processes should run in parallel, uses by default all cores
1864 --repository(-R): string # Path to repository to operate on
1865 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1866 --ignore-immutable # Allow rewriting immutable commits
1867 --at-operation: string # Operation to load the repo at
1868 --at-op: string # Operation to load the repo at
1869 --debug # Enable debug logging
1870 --color: string # When to colorize output (always, never, debug, auto)
1871 --quiet # Silence non-primary command output
1872 --no-pager # Disable the pager
1873 --config-toml: string # Additional configuration options (can be repeated)
1874 --help(-h) # Print help (see more with '--help')
1875 ]
1877 # Show commit description and changes in a revision
1878 export extern "jj show" [
1879 revision?: string # Show changes in this revision, compared to its parent(s)
1880 -r # Ignored (but lets you pass `-r` for consistency with other commands)
1881 --template(-T): string # Render a revision using the given template
1882 --summary(-s) # For each path, show only whether it was modified, added, or deleted
1883 --stat # Show a histogram of the changes
1884 --types # For each path, show only its type before and after
1885 --name-only # For each path, show only its path
1886 --git # Show a Git-format diff
1887 --color-words # Show a word-level diff with changes indicated only by color
1888 --tool: string # Generate diff by external command
1889 --context: string # Number of lines of context to show
1890 --ignore-all-space # Ignore whitespace when comparing lines
1891 --ignore-space-change # Ignore changes in amount of whitespace when comparing lines
1892 --repository(-R): string # Path to repository to operate on
1893 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1894 --ignore-immutable # Allow rewriting immutable commits
1895 --at-operation: string # Operation to load the repo at
1896 --at-op: string # Operation to load the repo at
1897 --debug # Enable debug logging
1898 --color: string # When to colorize output (always, never, debug, auto)
1899 --quiet # Silence non-primary command output
1900 --no-pager # Disable the pager
1901 --config-toml: string # Additional configuration options (can be repeated)
1902 --help(-h) # Print help (see more with '--help')
1903 ]
1905 # Simplify parent edges for the specified revision(s)
1906 export extern "jj simplify-parents" [
1907 --source(-s): string # Simplify specified revision(s) together with their trees of descendants (can be repeated)
1908 --revisions(-r): string # Simplify specified revision(s) (can be repeated)
1909 --repository(-R): string # Path to repository to operate on
1910 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1911 --ignore-immutable # Allow rewriting immutable commits
1912 --at-operation: string # Operation to load the repo at
1913 --at-op: string # Operation to load the repo at
1914 --debug # Enable debug logging
1915 --color: string # When to colorize output (always, never, debug, auto)
1916 --quiet # Silence non-primary command output
1917 --no-pager # Disable the pager
1918 --config-toml: string # Additional configuration options (can be repeated)
1919 --help(-h) # Print help (see more with '--help')
1920 ]
1922 # Manage which paths from the working-copy commit are present in the working copy
1923 export extern "jj sparse" [
1924 --repository(-R): string # Path to repository to operate on
1925 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1926 --ignore-immutable # Allow rewriting immutable commits
1927 --at-operation: string # Operation to load the repo at
1928 --at-op: string # Operation to load the repo at
1929 --debug # Enable debug logging
1930 --color: string # When to colorize output (always, never, debug, auto)
1931 --quiet # Silence non-primary command output
1932 --no-pager # Disable the pager
1933 --config-toml: string # Additional configuration options (can be repeated)
1934 --help(-h) # Print help (see more with '--help')
1935 ]
1937 # Start an editor to update the patterns that are present in the working copy
1938 export extern "jj sparse edit" [
1939 --repository(-R): string # Path to repository to operate on
1940 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1941 --ignore-immutable # Allow rewriting immutable commits
1942 --at-operation: string # Operation to load the repo at
1943 --at-op: string # Operation to load the repo at
1944 --debug # Enable debug logging
1945 --color: string # When to colorize output (always, never, debug, auto)
1946 --quiet # Silence non-primary command output
1947 --no-pager # Disable the pager
1948 --config-toml: string # Additional configuration options (can be repeated)
1949 --help(-h) # Print help (see more with '--help')
1950 ]
1952 # List the patterns that are currently present in the working copy
1953 export extern "jj sparse list" [
1954 --repository(-R): string # Path to repository to operate on
1955 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1956 --ignore-immutable # Allow rewriting immutable commits
1957 --at-operation: string # Operation to load the repo at
1958 --at-op: string # Operation to load the repo at
1959 --debug # Enable debug logging
1960 --color: string # When to colorize output (always, never, debug, auto)
1961 --quiet # Silence non-primary command output
1962 --no-pager # Disable the pager
1963 --config-toml: string # Additional configuration options (can be repeated)
1964 --help(-h) # Print help (see more with '--help')
1965 ]
1967 # Reset the patterns to include all files in the working copy
1968 export extern "jj sparse reset" [
1969 --repository(-R): string # Path to repository to operate on
1970 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1971 --ignore-immutable # Allow rewriting immutable commits
1972 --at-operation: string # Operation to load the repo at
1973 --at-op: string # Operation to load the repo at
1974 --debug # Enable debug logging
1975 --color: string # When to colorize output (always, never, debug, auto)
1976 --quiet # Silence non-primary command output
1977 --no-pager # Disable the pager
1978 --config-toml: string # Additional configuration options (can be repeated)
1979 --help(-h) # Print help (see more with '--help')
1980 ]
1982 # Update the patterns that are present in the working copy
1983 export extern "jj sparse set" [
1984 --add: string # Patterns to add to the working copy
1985 --remove: string # Patterns to remove from the working copy
1986 --clear # Include no files in the working copy (combine with --add)
1987 --repository(-R): string # Path to repository to operate on
1988 --ignore-working-copy # Don't snapshot the working copy, and don't update it
1989 --ignore-immutable # Allow rewriting immutable commits
1990 --at-operation: string # Operation to load the repo at
1991 --at-op: string # Operation to load the repo at
1992 --debug # Enable debug logging
1993 --color: string # When to colorize output (always, never, debug, auto)
1994 --quiet # Silence non-primary command output
1995 --no-pager # Disable the pager
1996 --config-toml: string # Additional configuration options (can be repeated)
1997 --help(-h) # Print help (see more with '--help')
1998 ]
2000 # Split a revision in two
2001 export extern "jj split" [
2002 --interactive(-i) # Interactively choose which parts to split. This is the default if no paths are provided
2003 --tool: string # Specify diff editor to be used (implies --interactive)
2004 --revision(-r): string # The revision to split
2005 --parallel(-p) # Split the revision into two parallel revisions instead of a parent and child
2006 ...paths: string # Put these paths in the first commit
2007 --repository(-R): string # Path to repository to operate on
2008 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2009 --ignore-immutable # Allow rewriting immutable commits
2010 --at-operation: string # Operation to load the repo at
2011 --at-op: string # Operation to load the repo at
2012 --debug # Enable debug logging
2013 --color: string # When to colorize output (always, never, debug, auto)
2014 --quiet # Silence non-primary command output
2015 --no-pager # Disable the pager
2016 --config-toml: string # Additional configuration options (can be repeated)
2017 --help(-h) # Print help (see more with '--help')
2018 ]
2020 # Move changes from a revision into another revision
2021 export extern "jj squash" [
2022 --revision(-r): string # Revision to squash into its parent (default: @)
2023 --from(-f): string # Revision(s) to squash from (default: @)
2024 --into(-t): string # Revision to squash into (default: @)
2025 --to: string # Revision to squash into (default: @)
2026 --message(-m): string # The description to use for squashed revision (don't open editor)
2027 --use-destination-message(-u) # Use the description of the destination revision and discard the description(s) of the source revision(s)
2028 --interactive(-i) # Interactively choose which parts to squash
2029 --tool: string # Specify diff editor to be used (implies --interactive)
2030 ...paths: string # Move only changes to these paths (instead of all paths)
2031 --keep-emptied(-k) # The source revision will not be abandoned
2032 --repository(-R): string # Path to repository to operate on
2033 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2034 --ignore-immutable # Allow rewriting immutable commits
2035 --at-operation: string # Operation to load the repo at
2036 --at-op: string # Operation to load the repo at
2037 --debug # Enable debug logging
2038 --color: string # When to colorize output (always, never, debug, auto)
2039 --quiet # Silence non-primary command output
2040 --no-pager # Disable the pager
2041 --config-toml: string # Additional configuration options (can be repeated)
2042 --help(-h) # Print help (see more with '--help')
2043 ]
2045 # Show high-level repo status
2046 export extern "jj status" [
2047 ...paths: string # Restrict the status display to these paths
2048 --repository(-R): string # Path to repository to operate on
2049 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2050 --ignore-immutable # Allow rewriting immutable commits
2051 --at-operation: string # Operation to load the repo at
2052 --at-op: string # Operation to load the repo at
2053 --debug # Enable debug logging
2054 --color: string # When to colorize output (always, never, debug, auto)
2055 --quiet # Silence non-primary command output
2056 --no-pager # Disable the pager
2057 --config-toml: string # Additional configuration options (can be repeated)
2058 --help(-h) # Print help (see more with '--help')
2059 ]
2061 # Manage tags
2062 export extern "jj tag" [
2063 --repository(-R): string # Path to repository to operate on
2064 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2065 --ignore-immutable # Allow rewriting immutable commits
2066 --at-operation: string # Operation to load the repo at
2067 --at-op: string # Operation to load the repo at
2068 --debug # Enable debug logging
2069 --color: string # When to colorize output (always, never, debug, auto)
2070 --quiet # Silence non-primary command output
2071 --no-pager # Disable the pager
2072 --config-toml: string # Additional configuration options (can be repeated)
2073 --help(-h) # Print help (see more with '--help')
2074 ]
2076 # List tags
2077 export extern "jj tag list" [
2078 ...names: string # Show tags whose local name matches
2079 --template(-T): string # Render each tag using the given template
2080 --repository(-R): string # Path to repository to operate on
2081 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2082 --ignore-immutable # Allow rewriting immutable commits
2083 --at-operation: string # Operation to load the repo at
2084 --at-op: string # Operation to load the repo at
2085 --debug # Enable debug logging
2086 --color: string # When to colorize output (always, never, debug, auto)
2087 --quiet # Silence non-primary command output
2088 --no-pager # Disable the pager
2089 --config-toml: string # Additional configuration options (can be repeated)
2090 --help(-h) # Print help (see more with '--help')
2091 ]
2093 # Infrequently used commands such as for generating shell completions
2094 export extern "jj util" [
2095 --repository(-R): string # Path to repository to operate on
2096 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2097 --ignore-immutable # Allow rewriting immutable commits
2098 --at-operation: string # Operation to load the repo at
2099 --at-op: string # Operation to load the repo at
2100 --debug # Enable debug logging
2101 --color: string # When to colorize output (always, never, debug, auto)
2102 --quiet # Silence non-primary command output
2103 --no-pager # Disable the pager
2104 --config-toml: string # Additional configuration options (can be repeated)
2105 --help(-h) # Print help (see more with '--help')
2106 ]
2108 def "nu-complete jj util completion shell" [] {
2109 [ "bash" "elvish" "fish" "nushell" "power-shell" "zsh" ]
2110 }
2112 # Print a command-line-completion script
2113 export extern "jj util completion" [
2114 shell?: string@"nu-complete jj util completion shell"
2115 --bash # Deprecated. Use the SHELL positional argument instead
2116 --fish # Deprecated. Use the SHELL positional argument instead
2117 --zsh # Deprecated. Use the SHELL positional argument instead
2118 --repository(-R): string # Path to repository to operate on
2119 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2120 --ignore-immutable # Allow rewriting immutable commits
2121 --at-operation: string # Operation to load the repo at
2122 --at-op: string # Operation to load the repo at
2123 --debug # Enable debug logging
2124 --color: string # When to colorize output (always, never, debug, auto)
2125 --quiet # Silence non-primary command output
2126 --no-pager # Disable the pager
2127 --config-toml: string # Additional configuration options (can be repeated)
2128 --help(-h) # Print help (see more with '--help')
2129 ]
2131 # Print the JSON schema for the jj TOML config format
2132 export extern "jj util config-schema" [
2133 --repository(-R): string # Path to repository to operate on
2134 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2135 --ignore-immutable # Allow rewriting immutable commits
2136 --at-operation: string # Operation to load the repo at
2137 --at-op: string # Operation to load the repo at
2138 --debug # Enable debug logging
2139 --color: string # When to colorize output (always, never, debug, auto)
2140 --quiet # Silence non-primary command output
2141 --no-pager # Disable the pager
2142 --config-toml: string # Additional configuration options (can be repeated)
2143 --help(-h) # Print help (see more with '--help')
2144 ]
2146 # Execute an external command via jj
2147 export extern "jj util exec" [
2148 command: string # External command to execute
2149 ...args: string # Arguments to pass to the external command
2150 --repository(-R): string # Path to repository to operate on
2151 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2152 --ignore-immutable # Allow rewriting immutable commits
2153 --at-operation: string # Operation to load the repo at
2154 --at-op: string # Operation to load the repo at
2155 --debug # Enable debug logging
2156 --color: string # When to colorize output (always, never, debug, auto)
2157 --quiet # Silence non-primary command output
2158 --no-pager # Disable the pager
2159 --config-toml: string # Additional configuration options (can be repeated)
2160 --help(-h) # Print help (see more with '--help')
2161 ]
2163 # Run backend-dependent garbage collection
2164 export extern "jj util gc" [
2165 --expire: string # Time threshold
2166 --repository(-R): string # Path to repository to operate on
2167 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2168 --ignore-immutable # Allow rewriting immutable commits
2169 --at-operation: string # Operation to load the repo at
2170 --at-op: string # Operation to load the repo at
2171 --debug # Enable debug logging
2172 --color: string # When to colorize output (always, never, debug, auto)
2173 --quiet # Silence non-primary command output
2174 --no-pager # Disable the pager
2175 --config-toml: string # Additional configuration options (can be repeated)
2176 --help(-h) # Print help (see more with '--help')
2177 ]
2179 # Print a ROFF (manpage)
2180 export extern "jj util mangen" [
2181 --repository(-R): string # Path to repository to operate on
2182 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2183 --ignore-immutable # Allow rewriting immutable commits
2184 --at-operation: string # Operation to load the repo at
2185 --at-op: string # Operation to load the repo at
2186 --debug # Enable debug logging
2187 --color: string # When to colorize output (always, never, debug, auto)
2188 --quiet # Silence non-primary command output
2189 --no-pager # Disable the pager
2190 --config-toml: string # Additional configuration options (can be repeated)
2191 --help(-h) # Print help (see more with '--help')
2192 ]
2194 # Print the CLI help for all subcommands in Markdown
2195 export extern "jj util markdown-help" [
2196 --repository(-R): string # Path to repository to operate on
2197 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2198 --ignore-immutable # Allow rewriting immutable commits
2199 --at-operation: string # Operation to load the repo at
2200 --at-op: string # Operation to load the repo at
2201 --debug # Enable debug logging
2202 --color: string # When to colorize output (always, never, debug, auto)
2203 --quiet # Silence non-primary command output
2204 --no-pager # Disable the pager
2205 --config-toml: string # Additional configuration options (can be repeated)
2206 --help(-h) # Print help (see more with '--help')
2207 ]
2209 def "nu-complete jj undo what" [] {
2210 [ "repo" "remote-tracking" ]
2211 }
2213 # Undo an operation (shortcut for `jj op undo`)
2214 export extern "jj undo" [
2215 operation?: string # The operation to undo
2216 --what: string@"nu-complete jj undo what" # What portions of the local state to restore (can be repeated)
2217 --repository(-R): string # Path to repository to operate on
2218 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2219 --ignore-immutable # Allow rewriting immutable commits
2220 --at-operation: string # Operation to load the repo at
2221 --at-op: string # Operation to load the repo at
2222 --debug # Enable debug logging
2223 --color: string # When to colorize output (always, never, debug, auto)
2224 --quiet # Silence non-primary command output
2225 --no-pager # Disable the pager
2226 --config-toml: string # Additional configuration options (can be repeated)
2227 --help(-h) # Print help (see more with '--help')
2228 ]
2230 # Move changes from a revision's parent into the revision
2231 export extern "jj unsquash" [
2232 --revision(-r): string
2233 --interactive(-i) # Interactively choose which parts to unsquash
2234 --tool: string # Specify diff editor to be used (implies --interactive)
2235 --repository(-R): string # Path to repository to operate on
2236 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2237 --ignore-immutable # Allow rewriting immutable commits
2238 --at-operation: string # Operation to load the repo at
2239 --at-op: string # Operation to load the repo at
2240 --debug # Enable debug logging
2241 --color: string # When to colorize output (always, never, debug, auto)
2242 --quiet # Silence non-primary command output
2243 --no-pager # Disable the pager
2244 --config-toml: string # Additional configuration options (can be repeated)
2245 --help(-h) # Print help (see more with '--help')
2246 ]
2248 # Stop tracking specified paths in the working copy
2249 export extern "jj untrack" [
2250 ...paths: string # Paths to untrack. They must already be ignored
2251 --repository(-R): string # Path to repository to operate on
2252 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2253 --ignore-immutable # Allow rewriting immutable commits
2254 --at-operation: string # Operation to load the repo at
2255 --at-op: string # Operation to load the repo at
2256 --debug # Enable debug logging
2257 --color: string # When to colorize output (always, never, debug, auto)
2258 --quiet # Silence non-primary command output
2259 --no-pager # Disable the pager
2260 --config-toml: string # Additional configuration options (can be repeated)
2261 --help(-h) # Print help (see more with '--help')
2262 ]
2264 # Display version information
2265 export extern "jj version" [
2266 --repository(-R): string # Path to repository to operate on
2267 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2268 --ignore-immutable # Allow rewriting immutable commits
2269 --at-operation: string # Operation to load the repo at
2270 --at-op: string # Operation to load the repo at
2271 --debug # Enable debug logging
2272 --color: string # When to colorize output (always, never, debug, auto)
2273 --quiet # Silence non-primary command output
2274 --no-pager # Disable the pager
2275 --config-toml: string # Additional configuration options (can be repeated)
2276 --help(-h) # Print help (see more with '--help')
2277 ]
2279 # Commands for working with workspaces
2280 export extern "jj workspace" [
2281 --repository(-R): string # Path to repository to operate on
2282 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2283 --ignore-immutable # Allow rewriting immutable commits
2284 --at-operation: string # Operation to load the repo at
2285 --at-op: string # Operation to load the repo at
2286 --debug # Enable debug logging
2287 --color: string # When to colorize output (always, never, debug, auto)
2288 --quiet # Silence non-primary command output
2289 --no-pager # Disable the pager
2290 --config-toml: string # Additional configuration options (can be repeated)
2291 --help(-h) # Print help (see more with '--help')
2292 ]
2294 def "nu-complete jj workspace add sparse_patterns" [] {
2295 [ "copy" "full" "empty" ]
2296 }
2298 # Add a workspace
2299 export extern "jj workspace add" [
2300 destination: string # Where to create the new workspace
2301 --name: string # A name for the workspace
2302 --revision(-r): string # A list of parent revisions for the working-copy commit of the newly created workspace. You may specify nothing, or any number of parents
2303 --sparse-patterns: string@"nu-complete jj workspace add sparse_patterns" # How to handle sparse patterns when creating a new workspace
2304 --repository(-R): string # Path to repository to operate on
2305 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2306 --ignore-immutable # Allow rewriting immutable commits
2307 --at-operation: string # Operation to load the repo at
2308 --at-op: string # Operation to load the repo at
2309 --debug # Enable debug logging
2310 --color: string # When to colorize output (always, never, debug, auto)
2311 --quiet # Silence non-primary command output
2312 --no-pager # Disable the pager
2313 --config-toml: string # Additional configuration options (can be repeated)
2314 --help(-h) # Print help (see more with '--help')
2315 ]
2317 # Stop tracking a workspace's working-copy commit in the repo
2318 export extern "jj workspace forget" [
2319 ...workspaces: string # Names of the workspaces to forget. By default, forgets only the current workspace
2320 --repository(-R): string # Path to repository to operate on
2321 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2322 --ignore-immutable # Allow rewriting immutable commits
2323 --at-operation: string # Operation to load the repo at
2324 --at-op: string # Operation to load the repo at
2325 --debug # Enable debug logging
2326 --color: string # When to colorize output (always, never, debug, auto)
2327 --quiet # Silence non-primary command output
2328 --no-pager # Disable the pager
2329 --config-toml: string # Additional configuration options (can be repeated)
2330 --help(-h) # Print help (see more with '--help')
2331 ]
2333 # List workspaces
2334 export extern "jj workspace list" [
2335 --repository(-R): string # Path to repository to operate on
2336 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2337 --ignore-immutable # Allow rewriting immutable commits
2338 --at-operation: string # Operation to load the repo at
2339 --at-op: string # Operation to load the repo at
2340 --debug # Enable debug logging
2341 --color: string # When to colorize output (always, never, debug, auto)
2342 --quiet # Silence non-primary command output
2343 --no-pager # Disable the pager
2344 --config-toml: string # Additional configuration options (can be repeated)
2345 --help(-h) # Print help (see more with '--help')
2346 ]
2348 # Renames the current workspace
2349 export extern "jj workspace rename" [
2350 new_workspace_name: string # The name of the workspace to update to
2351 --repository(-R): string # Path to repository to operate on
2352 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2353 --ignore-immutable # Allow rewriting immutable commits
2354 --at-operation: string # Operation to load the repo at
2355 --at-op: string # Operation to load the repo at
2356 --debug # Enable debug logging
2357 --color: string # When to colorize output (always, never, debug, auto)
2358 --quiet # Silence non-primary command output
2359 --no-pager # Disable the pager
2360 --config-toml: string # Additional configuration options (can be repeated)
2361 --help(-h) # Print help (see more with '--help')
2362 ]
2364 # Show the current workspace root directory
2365 export extern "jj workspace root" [
2366 --repository(-R): string # Path to repository to operate on
2367 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2368 --ignore-immutable # Allow rewriting immutable commits
2369 --at-operation: string # Operation to load the repo at
2370 --at-op: string # Operation to load the repo at
2371 --debug # Enable debug logging
2372 --color: string # When to colorize output (always, never, debug, auto)
2373 --quiet # Silence non-primary command output
2374 --no-pager # Disable the pager
2375 --config-toml: string # Additional configuration options (can be repeated)
2376 --help(-h) # Print help (see more with '--help')
2377 ]
2379 # Update a workspace that has become stale
2380 export extern "jj workspace update-stale" [
2381 --repository(-R): string # Path to repository to operate on
2382 --ignore-working-copy # Don't snapshot the working copy, and don't update it
2383 --ignore-immutable # Allow rewriting immutable commits
2384 --at-operation: string # Operation to load the repo at
2385 --at-op: string # Operation to load the repo at
2386 --debug # Enable debug logging
2387 --color: string # When to colorize output (always, never, debug, auto)
2388 --quiet # Silence non-primary command output
2389 --no-pager # Disable the pager
2390 --config-toml: string # Additional configuration options (can be repeated)
2391 --help(-h) # Print help (see more with '--help')
2392 ]
2396export use completions *

nushell/completions/pueue-completions.nu

Modified

+0 / −339 text lines

1module completions {
2
3 def "nu-complete pueue color" [] {
4 [ "auto" "never" "always" ]
5 }
6
7 # Interact with the Pueue daemon
8 export extern pueue [
9 --verbose(-v) # Verbose mode (-v, -vv, -vvv)
10 --color: string@"nu-complete pueue color" # Colorize the output; auto enables color output when connected to a tty
11 --config(-c): string # If provided, Pueue only uses this config file. This path can also be set via the "PUEUE_CONFIG_PATH" environment variable. The commandline option overwrites the environment variable!
12 --profile(-p): string # The name of the profile that should be loaded from your config file
13 --help(-h) # Print help
14 --version(-V) # Print version
15 ]
17 # Enqueue a task for execution. There're many different options when scheduling a task. Check the individual option help texts for more information. Furthermore, please remember that scheduled commands are executed via your system shell. This means that the command needs proper shell escaping. The safest way to preserve shell escaping is to surround your command with quotes, for example: pueue add 'ls $HOME && echo "Some string"'
18 export extern "pueue add" [
19 ...command: string # The command to be added
20 --working-directory(-w): string # Specify current working directory
21 --escape(-e) # Escape any special shell characters (" ", "&", "!", etc.). Beware: This implicitly disables nearly all shell specific syntax ("&&", "&>")
22 --immediate(-i) # Immediately start the task
23 --stashed(-s) # Create the task in Stashed state. Useful to avoid immediate execution if the queue is empty
24 --delay(-d): string # Prevents the task from being enqueued until 'delay' elapses. See "enqueue" for accepted formats
25 --group(-g): string # Assign the task to a group. Groups kind of act as separate queues. I.e. all groups run in parallel and you can specify the amount of parallel tasks for each group. If no group is specified, the default group will be used
26 --after(-a): string # Start the task once all specified tasks have successfully finished. As soon as one of the dependencies fails, this task will fail as well
27 --priority(-o): string # Start this task with a higher priority. The higher the number, the faster it will be processed
28 --label(-l): string # Add some information for yourself. This string will be shown in the "status" table. There's no additional logic connected to it
29 --print-task-id(-p) # Only return the task id instead of a text. This is useful when working with dependencies
30 --help(-h) # Print help
31 ]
33 # Remove tasks from the list. Running or paused tasks need to be killed first
34 export extern "pueue remove" [
35 ...task_ids: string # The task ids to be removed
36 --help(-h) # Print help
37 ]
39 # Switches the queue position of two commands. Only works on queued and stashed commands
40 export extern "pueue switch" [
41 task_id_1: string # The first task id
42 task_id_2: string # The second task id
43 --help(-h) # Print help
44 ]
46 # Stashed tasks won't be automatically started. You have to enqueue them or start them by hand
47 export extern "pueue stash" [
48 ...task_ids: string # Stash these specific tasks
49 --help(-h) # Print help
50 ]
52 # Enqueue stashed tasks. They'll be handled normally afterwards
53 export extern "pueue enqueue" [
54 ...task_ids: string # Enqueue these specific tasks
55 --delay(-d): string # Delay enqueuing these tasks until 'delay' elapses. See DELAY FORMAT below
56 --help(-h) # Print help
57 ]
59 # Resume operation of specific tasks or groups of tasks. By default, this resumes the default group and all its tasks. Can also be used force-start specific tasks.
60 export extern "pueue start" [
61 ...task_ids: string # Start these specific tasks. Paused tasks will resumed. Queued or Stashed tasks will be force-started
62 --group(-g): string # Resume a specific group and all paused tasks in it. The group will be set to running and its paused tasks will be resumed
63 --all(-a) # Resume all groups! All groups will be set to running and paused tasks will be resumed
64 --children(-c) # Deprecated: this switch no longer has any effect
65 --help(-h) # Print help
66 ]
68 # Restart failed or successful task(s). By default, identical tasks will be created and enqueued, but it's possible to restart in-place. You can also edit a few properties, such as the path and the command, before restarting.
69 export extern "pueue restart" [
70 ...task_ids: string # Restart these specific tasks
71 --all-failed(-a) # Restart all failed tasks across all groups. Nice to use in combination with `-i/--in-place`
72 --failed-in-group(-g): string # Like `--all-failed`, but only restart tasks failed tasks of a specific group. The group will be set to running and its paused tasks will be resumed
73 --start-immediately(-k) # Immediately start the tasks, no matter how many open slots there are. This will ignore any dependencies tasks may have
74 --stashed(-s) # Set the restarted task to a "Stashed" state. Useful to avoid immediate execution
75 --in-place(-i) # Restart the task by reusing the already existing tasks. This will overwrite any previous logs of the restarted tasks
76 --not-in-place # Restart the task by creating a new identical tasks. Only applies, if you have the restart_in_place configuration set to true
77 --edit(-e) # Edit the tasks' commands before restarting
78 --edit-path(-p) # Edit the tasks' paths before restarting
79 --edit-label(-l) # Edit the tasks' labels before restarting
80 --edit-priority(-o) # Edit the tasks' priorities before restarting
81 --help(-h) # Print help
82 ]
84 # Either pause running tasks or specific groups of tasks. By default, pauses the default group and all its tasks. A paused queue (group) won't start any new tasks.
85 export extern "pueue pause" [
86 ...task_ids: string # Pause these specific tasks. Does not affect the default group, groups or any other tasks
87 --group(-g): string # Pause a specific group
88 --all(-a) # Pause all groups!
89 --wait(-w) # Only pause the specified group and let already running tasks finish by themselves
90 --children(-c) # Deprecated: this switch no longer has any effect
91 --help(-h) # Print help
92 ]
94 # Kill specific running tasks or whole task groups.. Kills all tasks of the default group when no ids or a specific group are provided.
95 export extern "pueue kill" [
96 ...task_ids: string # Kill these specific tasks
97 --group(-g): string # Kill all running tasks in a group. This also pauses the group
98 --all(-a) # Kill all running tasks across ALL groups. This also pauses all groups
99 --children(-c) # Deprecated: this switch no longer has any effect
100 --signal(-s): string # Send a UNIX signal instead of simply killing the process. DISCLAIMER: This bypasses Pueue's process handling logic! You might enter weird invalid states, use at your own descretion
101 --help(-h) # Print help
102 ]
104 # Send something to a task. Useful for sending confirmations such as 'y\n'
105 export extern "pueue send" [
106 task_id: string # The id of the task
107 input: string # The input that should be sent to the process
108 --help(-h) # Print help
109 ]
111 # Edit the command, path, label, or priority of a stashed or queued task. By default only the command is edited. Multiple properties can be added in one go.
112 export extern "pueue edit" [
113 task_id: string # The task's id
114 --command(-c) # Edit the task's command
115 --path(-p) # Edit the task's path
116 --label(-l) # Edit the task's label
117 --priority(-o) # Edit the task's priority
118 --help(-h) # Print help
119 ]
121 # Use this to add or remove groups. By default, this will simply display all known groups.
122 export extern "pueue group" [
123 --json(-j) # Print the list of groups as json
124 --help(-h) # Print help
125 ]
127 # Add a group by name
128 export extern "pueue group add" [
129 name: string
130 --parallel(-p): string # Set the amount of parallel tasks this group can have. Setting this to 0 means an unlimited amount of parallel tasks
131 --help(-h) # Print help
132 ]
134 # Remove a group by name. This will move all tasks in this group to the default group!
135 export extern "pueue group remove" [
136 name: string
137 --help(-h) # Print help
138 ]
140 # Print this message or the help of the given subcommand(s)
141 export extern "pueue group help" [
142 ]
144 # Add a group by name
145 export extern "pueue group help add" [
146 ]
148 # Remove a group by name. This will move all tasks in this group to the default group!
149 export extern "pueue group help remove" [
150 ]
152 # Print this message or the help of the given subcommand(s)
153 export extern "pueue group help help" [
154 ]
156 # Display the current status of all tasks
157 export extern "pueue status" [
158 ...query: string # Users can specify a custom query to filter for specific values, order by a column or limit the amount of tasks listed. Use `--help` for the full syntax definition
159 --json(-j) # Print the current state as json to stdout. This does not include the output of tasks. Use `log -j` if you want everything
160 --group(-g): string # Only show tasks of a specific group
161 --help(-h) # Print help (see more with '--help')
162 ]
164 # Accept a list or map of JSON pueue tasks via stdin and display it just like "pueue status". A simple example might look like this: pueue status --json | jq -c '.tasks' | pueue format-status
165 export extern "pueue format-status" [
166 --group(-g): string # Only show tasks of a specific group
167 --help(-h) # Print help
168 ]
170 # Display the log output of finished tasks. Only the last few lines will be shown by default. If you want to follow the output of a task, please use the "follow" subcommand.
171 export extern "pueue log" [
172 ...task_ids: string # View the task output of these specific tasks
173 --json(-j) # Print the resulting tasks and output as json. By default only the last lines will be returned unless --full is provided. Take care, as the json cannot be streamed! If your logs are really huge, using --full can use all of your machine's RAM
174 --lines(-l): string # Only print the last X lines of each task's output. This is done by default if you're looking at multiple tasks
175 --full(-f) # Show the whole output
176 --help(-h) # Print help
177 ]
179 # Follow the output of a currently running task. This command works like "tail -f"
180 export extern "pueue follow" [
181 task_id?: string # The id of the task you want to watch. If no or multiple tasks are running, you have to specify the id. If only a single task is running, you can omit the id
182 --lines(-l): string # Only print the last X lines of the output before following
183 --help(-h) # Print help
184 ]
186 # Wait until tasks are finished. By default, this will wait for all tasks in the default group to finish. Note: This will also wait for all tasks that aren't somehow 'Done'. Includes: [Paused, Stashed, Locked, Queued, ...]
187 export extern "pueue wait" [
188 ...task_ids: string # This allows you to wait for specific tasks to finish
189 --group(-g): string # Wait for all tasks in a specific group
190 --all(-a) # Wait for all tasks across all groups and the default group
191 --quiet(-q) # Don't show any log output while waiting
192 --status(-s): string # Wait for tasks to reach a specific task status
193 --help(-h) # Print help
194 ]
196 # Remove all finished tasks from the list
197 export extern "pueue clean" [
198 --successful-only(-s) # Only clean tasks that finished successfully
199 --group(-g): string # Only clean tasks of a specific group
200 --help(-h) # Print help
201 ]
203 # Kill all tasks, clean up afterwards and reset EVERYTHING!
204 export extern "pueue reset" [
205 --children(-c) # Deprecated: this switch no longer has any effect
206 --force(-f) # Don't ask for any confirmation
207 --help(-h) # Print help
208 ]
210 # Remotely shut down the daemon. Should only be used if the daemon isn't started by a service manager
211 export extern "pueue shutdown" [
212 --help(-h) # Print help
213 ]
215 # Set the amount of allowed parallel tasks By default, adjusts the amount of the default group. No tasks will be stopped, if this is lowered. This limit is only considered when tasks are scheduled.
216 export extern "pueue parallel" [
217 parallel_tasks?: string # The amount of allowed parallel tasks. Setting this to 0 means an unlimited amount of parallel tasks
218 --group(-g): string # Set the amount for a specific group
219 --help(-h) # Print help
220 ]
222 def "nu-complete pueue completions shell" [] {
223 [ "bash" "elvish" "fish" "power-shell" "zsh" "nushell" ]
224 }
226 # Generates shell completion files. This can be ignored during normal operations
227 export extern "pueue completions" [
228 shell: string@"nu-complete pueue completions shell" # The target shell
229 output_directory?: string # The output directory to which the file should be written
230 --help(-h) # Print help
231 ]
233 # Print this message or the help of the given subcommand(s)
234 export extern "pueue help" [
235 ]
237 # Enqueue a task for execution. There're many different options when scheduling a task. Check the individual option help texts for more information. Furthermore, please remember that scheduled commands are executed via your system shell. This means that the command needs proper shell escaping. The safest way to preserve shell escaping is to surround your command with quotes, for example: pueue add 'ls $HOME && echo "Some string"'
238 export extern "pueue help add" [
239 ]
241 # Remove tasks from the list. Running or paused tasks need to be killed first
242 export extern "pueue help remove" [
243 ]
245 # Switches the queue position of two commands. Only works on queued and stashed commands
246 export extern "pueue help switch" [
247 ]
249 # Stashed tasks won't be automatically started. You have to enqueue them or start them by hand
250 export extern "pueue help stash" [
251 ]
253 # Enqueue stashed tasks. They'll be handled normally afterwards
254 export extern "pueue help enqueue" [
255 ]
257 # Resume operation of specific tasks or groups of tasks. By default, this resumes the default group and all its tasks. Can also be used force-start specific tasks.
258 export extern "pueue help start" [
259 ]
261 # Restart failed or successful task(s). By default, identical tasks will be created and enqueued, but it's possible to restart in-place. You can also edit a few properties, such as the path and the command, before restarting.
262 export extern "pueue help restart" [
263 ]
265 # Either pause running tasks or specific groups of tasks. By default, pauses the default group and all its tasks. A paused queue (group) won't start any new tasks.
266 export extern "pueue help pause" [
267 ]
269 # Kill specific running tasks or whole task groups.. Kills all tasks of the default group when no ids or a specific group are provided.
270 export extern "pueue help kill" [
271 ]
273 # Send something to a task. Useful for sending confirmations such as 'y\n'
274 export extern "pueue help send" [
275 ]
277 # Edit the command, path, label, or priority of a stashed or queued task. By default only the command is edited. Multiple properties can be added in one go.
278 export extern "pueue help edit" [
279 ]
281 # Use this to add or remove groups. By default, this will simply display all known groups.
282 export extern "pueue help group" [
283 ]
285 # Add a group by name
286 export extern "pueue help group add" [
287 ]
289 # Remove a group by name. This will move all tasks in this group to the default group!
290 export extern "pueue help group remove" [
291 ]
293 # Display the current status of all tasks
294 export extern "pueue help status" [
295 ]
297 # Accept a list or map of JSON pueue tasks via stdin and display it just like "pueue status". A simple example might look like this: pueue status --json | jq -c '.tasks' | pueue format-status
298 export extern "pueue help format-status" [
299 ]
301 # Display the log output of finished tasks. Only the last few lines will be shown by default. If you want to follow the output of a task, please use the "follow" subcommand.
302 export extern "pueue help log" [
303 ]
305 # Follow the output of a currently running task. This command works like "tail -f"
306 export extern "pueue help follow" [
307 ]
309 # Wait until tasks are finished. By default, this will wait for all tasks in the default group to finish. Note: This will also wait for all tasks that aren't somehow 'Done'. Includes: [Paused, Stashed, Locked, Queued, ...]
310 export extern "pueue help wait" [
311 ]
313 # Remove all finished tasks from the list
314 export extern "pueue help clean" [
315 ]
317 # Kill all tasks, clean up afterwards and reset EVERYTHING!
318 export extern "pueue help reset" [
319 ]
321 # Remotely shut down the daemon. Should only be used if the daemon isn't started by a service manager
322 export extern "pueue help shutdown" [
323 ]
325 # Set the amount of allowed parallel tasks By default, adjusts the amount of the default group. No tasks will be stopped, if this is lowered. This limit is only considered when tasks are scheduled.
326 export extern "pueue help parallel" [
327 ]
329 # Generates shell completion files. This can be ignored during normal operations
330 export extern "pueue help completions" [
331 ]
333 # Print this message or the help of the given subcommand(s)
334 export extern "pueue help help" [
335 ]
337}
339export use completions *

tools/aes.java

Modified

+233 / −233 text lines

1import static java.lang.System.out;
2import static java.nio.file.StandardOpenOption.CREATE_NEW;
3import static java.nio.file.StandardOpenOption.READ;
4import static java.nio.file.StandardOpenOption.WRITE;
5
6import java.nio.file.*;
7import java.nio.charset.*;
8import java.nio.*;
9import java.io.*;
11import java.security.*;
13import javax.crypto.*;
14import javax.crypto.spec.*;
16class aes {
17 enum Command {
18 ENCRYPT, DECRYPT
19 }
21 static Cipher AES_GCM_PKCS5;
22 static byte[] SALT = new byte[] { 116, 104, 101, 32, 109, 111, 111, 110, 32, 105, 115, 32, 104, 105, 100, 100, 101,
23 110, 32, 105, 110, 32, 112, 108, 97, 105, 110, 32, 118, 105, 101, 119 };
24 static SecureRandom RANDOM = new SecureRandom();
25 /*
26 * 12 ist NIST recommendation. supposedly fast and secure enough...
27 */
28 static int GCM_IV_SIZE = 12;
29 /*
30 * AES encrypts 128-blocks internally, so this should be reasonable memory bufer
31 * size.
32 */
33 static int READ_BUFFER_SIZE = 128;
34 /*
35 * Supported sizes for GCM authentication tags seem to be {128, 120, 112, 104,
36 * 96}.
37 * But we do not really care, since we do not use them here.
38 */
39 static int GCM_AUTH_TAG_SIZE = 96;
41 public static void main(String[] arguments) throws Throwable {
42 if (arguments.length == 0) {
43 usage();
44 throw fail();
45 }
47 var input_command = arguments[0];
48 Command command;
49 if ("encrypt".startsWith(input_command)) {
50 command = Command.ENCRYPT;
51 } else if ("decrypt".startsWith(input_command)) {
52 command = Command.DECRYPT;
53 } else {
54 throw fail("unknown command %s given%n", emphasize_global(input_command));
55 }
57 AES_GCM_PKCS5 = Cipher.getInstance("AES/GCM/NoPadding");
59 var console = System.console();
60 /*
61 * If there is no console, this program is most likely part of a pipe.
62 * In such cases a `--password-file` flag is mandatory, because we cannot
63 * interactively ask for the password.
64 */
65 if (console == null) {
66 if (arguments.length != 3 || !"--password-file".equals(arguments[1])) {
67 usage();
68 throw fail(
69 "When running %s non-interactively, the %s flag is required.%nOtherwise there is no way to securely obtain the password.%n",
70 emphasize_local("aes"), emphasize_global("--password-file"));
71 }
72 var password_file = Path.of(arguments[2]);
73 if (!Files.exists(password_file)) {
74 throw fail("the given password file %s does not exist%n", emphasize_local(password_file.toString()));
75 }
76 var password = toChars(Files.readAllBytes(password_file));
77 switch (command) {
78 case ENCRYPT:
79 encrypt(password, System.in, System.out);
80 break;
81 case DECRYPT:
82 decrypt(password, System.in, System.out);
83 break;
84 }
85 } else {
86 if (arguments.length <= 1) {
87 usage();
88 throw fail("not enough arguments given%n");
89 }
90 char[] password;
91 String input;
92 String output;
93 if ("--password-file".equals(arguments[1])) {
94 if (arguments.length != 5) {
95 usage();
96 throw fail("the flag %s requires a path%n", emphasize_local("--password-file"));
97 }
98 var password_file = Path.of(arguments[2]);
99 if (!Files.exists(password_file)) {
100 throw fail("the given password file %s does not exist%n", emphasize_local(password_file.toString()));
101 }
102 password = toChars(Files.readAllBytes(password_file));
103 input = arguments[3];
104 output = arguments[4];
105 } else {
106 if (arguments.length != 3) {
107 usage();
108 throw fail("when encrypting/decrypting a file, an output path is required%n");
109 }
110 password = console.readPassword("[%s]:", emphasize_global("Password"));
111 input = arguments[1];
112 output = arguments[2];
113 }
115 var input_path = Path.of(input);
116 if (!Files.exists(input_path)) {
117 throw fail("the given input path %s does not exist%n", emphasize_global(input_path.toString()));
118 }
119 var output_path = Path.of(output);
120 if (Files.exists(output_path)) {
121 throw fail("the output path %s already exists%n", emphasize_global(output_path.toString()));
122 }
124 try (var input_stream = Files.newInputStream(input_path, READ);
125 var output_stream = Files.newOutputStream(output_path, CREATE_NEW, WRITE);) {
126 switch (command) {
127 case ENCRYPT:
128 encrypt(password, input_stream, output_stream);
129 break;
130 case DECRYPT:
131 decrypt(password, input_stream, output_stream);
132 break;
133 }
134 }
135 }
136 throw exit();
137 }
139 static void encrypt(char[] password, InputStream input, OutputStream output) throws Exception {
140 // FIXME: generate random salt and append it here just like IV
141 // in GCM the IV should be unique per encrypted thingy
142 var initialization_vector = new byte[GCM_IV_SIZE];
143 RANDOM.nextBytes(initialization_vector);
144 // save the IV for the decryption step later. secure? nope. but how else are we
145 // to share IVs between encryption/decryption?
146 output.write(initialization_vector);
147 var secret = toSecretKey(password);
148 var parameter_spec = new GCMParameterSpec(GCM_AUTH_TAG_SIZE, initialization_vector);
150 AES_GCM_PKCS5.init(Cipher.ENCRYPT_MODE, secret, parameter_spec);
151 var read_buffer = new byte[READ_BUFFER_SIZE];
152 var aes_buffer = new byte[READ_BUFFER_SIZE];
153 int read_bytes_count = 0;
154 while ((read_bytes_count = input.read(read_buffer)) != -1) {
155 var aes_bytes_count = AES_GCM_PKCS5.update(read_buffer, 0, read_bytes_count, aes_buffer);
156 output.write(aes_buffer, 0, aes_bytes_count);
157 }
158 output.write(AES_GCM_PKCS5.doFinal());
159 }
161 static void decrypt(char[] password, InputStream input, OutputStream output) throws Exception {
162 // the IV get prepended to the data during encryption
163 var initialization_vector = new byte[GCM_IV_SIZE];
164 input.read(initialization_vector);
165 var parameter_spec = new GCMParameterSpec(GCM_AUTH_TAG_SIZE, initialization_vector);
166 var secret = toSecretKey(password);
168 AES_GCM_PKCS5.init(Cipher.DECRYPT_MODE, secret, parameter_spec);
169 var read_buffer = new byte[READ_BUFFER_SIZE];
170 var aes_buffer = new byte[READ_BUFFER_SIZE];
171 int read_bytes_count = 0;
172 while ((read_bytes_count = input.read(read_buffer)) != -1) {
173 var aes_bytes_count = AES_GCM_PKCS5.update(read_buffer, 0, read_bytes_count, aes_buffer);
174 output.write(aes_buffer, 0, aes_bytes_count);
175 }
176 // the java impl of GCM seems to buffer the whole data in memory and only
177 // releasing it on doFinal. yuck!
178 // there is not much i can do about this other than to wait for JDK patches.
179 // TODO: in the case of AES GCM the final byte block is the authentication tag.
180 // as such it should porbably NOT be written to the output file.
181 // or is this assumption wrong?
182 output.write(AES_GCM_PKCS5.doFinal());
183 // FIXME: when given a wrong password we get a nonsensical error. make this
184 // nicer for human
185 }
187 static SecretKey toSecretKey(char[] password) throws Exception {
188 var factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
189 var spec = new PBEKeySpec(password, SALT, 65536, 256);
190 return new SecretKeySpec(factory.generateSecret(spec).getEncoded(), "AES");
191 }
193 static char[] toChars(byte[] bytes) {
194 var byte_buffer = ByteBuffer.wrap(bytes);
195 var char_buffer = StandardCharsets.UTF_8.decode(byte_buffer);
196 return char_buffer.array();
197 }
199 static void usage() {
200 out.printf("%s encrypts/decrypts data.%n", emphasize_local("Symmetrically "));
201 out.printf("%s: java aes.java <e(ncrypt)|d(ecrypt)> [--password-file <path>] <input path> <output path>%n",
202 emphasize_global("Usage for files"));
203 out.printf("%s: java aes.java <e(ncrypt)|d(ecrypt)> --password-file <path>%n",
204 emphasize_global("Usage for stdin/stdout"));
205 }
207 static Throwable exit() {
208 System.exit(0);
209 // abuse control flow to make compiler realize `exit` will never return
210 return new Throwable();
211 }
213 static String emphasize_global(String message) {
214 return "\033[4m" + message + "\033[0m";
215 }
217 static String emphasize_local(String message) {
218 return "\033[3m" + message + "\033[0m";
219 }
221 static Throwable fail(String message, Object... arguments) {
222 out.printf(message, arguments);
223 System.exit(-1);
224 // abuse control flow to make compiler realize `fail` will never return
225 return new Throwable();
226 }
228 static Throwable fail() {
229 System.exit(-1);
230 // abuse control flow to make compiler realize `fail` will never return
231 return new Throwable();
232 }
233}
1import static java.lang.System.out;
2import static java.nio.file.StandardOpenOption.CREATE_NEW;
3import static java.nio.file.StandardOpenOption.READ;
4import static java.nio.file.StandardOpenOption.WRITE;
5
6import java.nio.file.*;
7import java.nio.charset.*;
8import java.nio.*;
9import java.io.*;
10
11import java.security.*;
12
13import javax.crypto.*;
14import javax.crypto.spec.*;
15
16class aes {
17 enum Command {
18 ENCRYPT, DECRYPT
19 }
20
21 static Cipher AES_GCM_PKCS5;
22 static byte[] SALT = new byte[] { 116, 104, 101, 32, 109, 111, 111, 110, 32, 105, 115, 32, 104, 105, 100, 100, 101,
23 110, 32, 105, 110, 32, 112, 108, 97, 105, 110, 32, 118, 105, 101, 119 };
24 static SecureRandom RANDOM = new SecureRandom();
25 /*
26 * 12 ist NIST recommendation. supposedly fast and secure enough...
27 */
28 static int GCM_IV_SIZE = 12;
29 /*
30 * AES encrypts 128-blocks internally, so this should be reasonable memory bufer
31 * size.
32 */
33 static int READ_BUFFER_SIZE = 128;
34 /*
35 * Supported sizes for GCM authentication tags seem to be {128, 120, 112, 104,
36 * 96}.
37 * But we do not really care, since we do not use them here.
38 */
39 static int GCM_AUTH_TAG_SIZE = 96;
40
41 public static void main(String[] arguments) throws Throwable {
42 if (arguments.length == 0) {
43 usage();
44 throw fail();
45 }
46
47 var input_command = arguments[0];
48 Command command;
49 if ("encrypt".startsWith(input_command)) {
50 command = Command.ENCRYPT;
51 } else if ("decrypt".startsWith(input_command)) {
52 command = Command.DECRYPT;
53 } else {
54 throw fail("unknown command %s given%n", emphasize_global(input_command));
55 }
56
57 AES_GCM_PKCS5 = Cipher.getInstance("AES/GCM/NoPadding");
58
59 var console = System.console();
60 /*
61 * If there is no console, this program is most likely part of a pipe.
62 * In such cases a `--password-file` flag is mandatory, because we cannot
63 * interactively ask for the password.
64 */
65 if (console == null) {
66 if (arguments.length != 3 || !"--password-file".equals(arguments[1])) {
67 usage();
68 throw fail(
69 "When running %s non-interactively, the %s flag is required.%nOtherwise there is no way to securely obtain the password.%n",
70 emphasize_local("aes"), emphasize_global("--password-file"));
71 }
72 var password_file = Path.of(arguments[2]);
73 if (!Files.exists(password_file)) {
74 throw fail("the given password file %s does not exist%n", emphasize_local(password_file.toString()));
75 }
76 var password = toChars(Files.readAllBytes(password_file));
77 switch (command) {
78 case ENCRYPT:
79 encrypt(password, System.in, System.out);
80 break;
81 case DECRYPT:
82 decrypt(password, System.in, System.out);
83 break;
84 }
85 } else {
86 if (arguments.length <= 1) {
87 usage();
88 throw fail("not enough arguments given%n");
89 }
90 char[] password;
91 String input;
92 String output;
93 if ("--password-file".equals(arguments[1])) {
94 if (arguments.length != 5) {
95 usage();
96 throw fail("the flag %s requires a path%n", emphasize_local("--password-file"));
97 }
98 var password_file = Path.of(arguments[2]);
99 if (!Files.exists(password_file)) {
100 throw fail("the given password file %s does not exist%n", emphasize_local(password_file.toString()));
101 }
102 password = toChars(Files.readAllBytes(password_file));
103 input = arguments[3];
104 output = arguments[4];
105 } else {
106 if (arguments.length != 3) {
107 usage();
108 throw fail("when encrypting/decrypting a file, an output path is required%n");
109 }
110 password = console.readPassword("[%s]:", emphasize_global("Password"));
111 input = arguments[1];
112 output = arguments[2];
113 }
114
115 var input_path = Path.of(input);
116 if (!Files.exists(input_path)) {
117 throw fail("the given input path %s does not exist%n", emphasize_global(input_path.toString()));
118 }
119 var output_path = Path.of(output);
120 if (Files.exists(output_path)) {
121 throw fail("the output path %s already exists%n", emphasize_global(output_path.toString()));
122 }
123
124 try (var input_stream = Files.newInputStream(input_path, READ);
125 var output_stream = Files.newOutputStream(output_path, CREATE_NEW, WRITE);) {
126 switch (command) {
127 case ENCRYPT:
128 encrypt(password, input_stream, output_stream);
129 break;
130 case DECRYPT:
131 decrypt(password, input_stream, output_stream);
132 break;
133 }
134 }
135 }
136 throw exit();
137 }
138
139 static void encrypt(char[] password, InputStream input, OutputStream output) throws Exception {
140 // FIXME: generate random salt and append it here just like IV
141 // in GCM the IV should be unique per encrypted thingy
142 var initialization_vector = new byte[GCM_IV_SIZE];
143 RANDOM.nextBytes(initialization_vector);
144 // save the IV for the decryption step later. secure? nope. but how else are we
145 // to share IVs between encryption/decryption?
146 output.write(initialization_vector);
147 var secret = toSecretKey(password);
148 var parameter_spec = new GCMParameterSpec(GCM_AUTH_TAG_SIZE, initialization_vector);
149
150 AES_GCM_PKCS5.init(Cipher.ENCRYPT_MODE, secret, parameter_spec);
151 var read_buffer = new byte[READ_BUFFER_SIZE];
152 var aes_buffer = new byte[READ_BUFFER_SIZE];
153 int read_bytes_count = 0;
154 while ((read_bytes_count = input.read(read_buffer)) != -1) {
155 var aes_bytes_count = AES_GCM_PKCS5.update(read_buffer, 0, read_bytes_count, aes_buffer);
156 output.write(aes_buffer, 0, aes_bytes_count);
157 }
158 output.write(AES_GCM_PKCS5.doFinal());
159 }
160
161 static void decrypt(char[] password, InputStream input, OutputStream output) throws Exception {
162 // the IV get prepended to the data during encryption
163 var initialization_vector = new byte[GCM_IV_SIZE];
164 input.read(initialization_vector);
165 var parameter_spec = new GCMParameterSpec(GCM_AUTH_TAG_SIZE, initialization_vector);
166 var secret = toSecretKey(password);
167
168 AES_GCM_PKCS5.init(Cipher.DECRYPT_MODE, secret, parameter_spec);
169 var read_buffer = new byte[READ_BUFFER_SIZE];
170 var aes_buffer = new byte[READ_BUFFER_SIZE];
171 int read_bytes_count = 0;
172 while ((read_bytes_count = input.read(read_buffer)) != -1) {
173 var aes_bytes_count = AES_GCM_PKCS5.update(read_buffer, 0, read_bytes_count, aes_buffer);
174 output.write(aes_buffer, 0, aes_bytes_count);
175 }
176 // the java impl of GCM seems to buffer the whole data in memory and only
177 // releasing it on doFinal. yuck!
178 // there is not much i can do about this other than to wait for JDK patches.
179 // TODO: in the case of AES GCM the final byte block is the authentication tag.
180 // as such it should porbably NOT be written to the output file.
181 // or is this assumption wrong?
182 output.write(AES_GCM_PKCS5.doFinal());
183 // FIXME: when given a wrong password we get a nonsensical error. make this
184 // nicer for human
185 }
186
187 static SecretKey toSecretKey(char[] password) throws Exception {
188 var factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
189 var spec = new PBEKeySpec(password, SALT, 65536, 256);
190 return new SecretKeySpec(factory.generateSecret(spec).getEncoded(), "AES");
191 }
192
193 static char[] toChars(byte[] bytes) {
194 var byte_buffer = ByteBuffer.wrap(bytes);
195 var char_buffer = StandardCharsets.UTF_8.decode(byte_buffer);
196 return char_buffer.array();
197 }
198
199 static void usage() {
200 out.printf("%s encrypts/decrypts data.%n", emphasize_local("Symmetrically "));
201 out.printf("%s: java aes.java <e(ncrypt)|d(ecrypt)> [--password-file <path>] <input path> <output path>%n",
202 emphasize_global("Usage for files"));
203 out.printf("%s: java aes.java <e(ncrypt)|d(ecrypt)> --password-file <path>%n",
204 emphasize_global("Usage for stdin/stdout"));
205 }
206
207 static Throwable exit() {
208 System.exit(0);
209 // abuse control flow to make compiler realize `exit` will never return
210 return new Throwable();
211 }
212
213 static String emphasize_global(String message) {
214 return "\033[4m" + message + "\033[0m";
215 }
216
217 static String emphasize_local(String message) {
218 return "\033[3m" + message + "\033[0m";
219 }
220
221 static Throwable fail(String message, Object... arguments) {
222 out.printf(message, arguments);
223 System.exit(-1);
224 // abuse control flow to make compiler realize `fail` will never return
225 return new Throwable();
226 }
227
228 static Throwable fail() {
229 System.exit(-1);
230 // abuse control flow to make compiler realize `fail` will never return
231 return new Throwable();
232 }
233}

tools/crates.csv

Added
new file mode 100644

+60 / −0 text lines

1name;bin;cargo_args
2asm-cli-rust; asm-cli-rust; --git https://github.com/cch123/asm-cli-rust
3bat
4bk
5bottom; btm
6cargo-cache
7cargo-update;cargo-install-update
8carl
9calendar-rs;calendar
10du-dust; dust
11dotenv-linter
12diskonaut
13eva
14emplace
15eza; eza; --features vendored-openssl,vendored-libgit2
16fend
17fd-find;fd
18git-delta;delta
19gitu;gitu; --locked
20gitoxide;gix
21hexyl
22hyperfine
23inlyne
24jj-cli; jj; --locked --bin jj
25just
26lms
27lurk-cli; lurk
28lychee;lychee; --locked --no-default-features --features rustls-tls,email-check
29macchina
30mdbook
31mdcat
32monolith
33names
34netscanner
35neovide;neovide; --git https://github.com/neovide/neovide
36nu;nu; --locked
37nu_plugin_audio_hook; nu_plugin_audio_hook; --git https://github.com/FMotalleb/nu_plugin_audio_hook.git --features all-decoders
38ouch
39pastel
40presenterm
41pueue;pueue;--locked
42ripgrep;rg
43rbw
44skim;sk
45sbyte
46sniffnet
47taplo-cli;taplo; --locked --features lsp
48tealdeer;tldr
49tokei
50topgrade
51tsdl
52ttyper
53unison-fsmonitor
54ugdb
55vivid
56wthrr
57yazi-cli;ya; --locked
58yazi-fm;yazi; --locked
59zoxide
60

tools/download_jar.java

Modified

+198 / −198 text lines

1import static java.lang.System.out;
2
3import java.io.*;
4import java.net.*;
5import java.net.http.*;
6import java.net.http.HttpResponse.*;
7import java.nio.file.*;
8import java.util.*;
9import java.util.concurrent.ConcurrentSkipListSet;
11class download_jar {
12 public static void main(final String[] command_line_arguments) {
13 help();
14 var current_working_directory = Paths.get(System.getProperty("user.dir"));
15 var download_directory = current_working_directory.resolve("downloaded_artifacts");
16 var maven_repository = "https://repo.maven.apache.org/maven2";
17 var expected_count_of_arguments = 3;
18 if (contains(command_line_arguments, "-d")) {
19 expected_count_of_arguments = expected_count_of_arguments + 2;
20 try {
21 var given_download_directory = command_line_arguments[index_of(command_line_arguments, "-d") + 1];
22 download_directory = current_working_directory.resolve(given_download_directory);
23 } catch (IndexOutOfBoundsException exception) {
24 out.println("The -d option requires an argument.");
25 usage();
26 fail();
27 }
28 }
29 if (contains(command_line_arguments, "-r")) {
30 expected_count_of_arguments = expected_count_of_arguments + 2;
31 try {
32 var given_maven_repository = command_line_arguments[index_of(command_line_arguments, "-r") + 1];
33 maven_repository = given_maven_repository;
34 } catch (IndexOutOfBoundsException exception) {
35 out.println("The -r option requires an argument.");
36 usage();
37 fail();
38 }
39 }
40 if (command_line_arguments.length != expected_count_of_arguments) {
41 usage();
42 fail();
43 }
44 var maven_coordinates_reversed = new String[3];
45 for (var index = 2; index >= 0; --index) {
46 maven_coordinates_reversed[index] = command_line_arguments[expected_count_of_arguments - index - 1];
47 }
48 var group_id = maven_coordinates_reversed[2];
49 var artifact_id = maven_coordinates_reversed[1];
50 var version = maven_coordinates_reversed[0];
52 if (Files.exists(download_directory) && Files.isRegularFile(download_directory)) {
53 fail("The given download directory path %s already points to a file!%n", download_directory.toString());
54 } else if (!Files.exists(download_directory)) {
55 out.printf("Creating directory at %s%n.", emphasize_global(download_directory.toString()));
56 try {
57 Files.createDirectories(download_directory);
58 } catch (IOException __) {
59 fail("Unable to create directory at %s", emphasize_global(download_directory.toString()));
60 }
61 }
63 var expected_artifact_base_url = guess_maven_artifact_url(maven_repository, group_id, artifact_id, version);
64 var client = HttpClient.newHttpClient();
65 var request = HttpRequest.newBuilder().uri(URI.create(expected_artifact_base_url)).build();
66 var target_directory = download_directory;
67 client.sendAsync(request, BodyHandlers.ofString()).thenApply(HttpResponse::statusCode).thenAccept(status -> {
68 if (status > 299) {
69 fail("Could not find maven artifact at %s.%n", expected_artifact_base_url);
70 } else {
71 download_ressource(client, target_directory,
72 build_ressource_url(expected_artifact_base_url, artifact_id, version, ".jar"));
73 download_ressource(client, target_directory,
74 build_ressource_url(expected_artifact_base_url, artifact_id, version, "-sources.jar"));
75 // FIXME BLOCKER! How do we implement the version clash resolution?
76 // Preferably in a manner that avoids pointless downloads...
77 var processed_cache = new ConcurrentSkipListSet<String>();
78 process_pom(client, processed_cache,
79 build_ressource_url(expected_artifact_base_url, artifact_id, version, ".pom"));
80 }
81 }).join();
83 out.printf("download directory:\t%s%nmaven repository:\t%s%nmaven coordinates:\t%s:%s:%s%n",
84 emphasize_global(download_directory.toString()), emphasize_global(maven_repository), emphasize_global(group_id),
85 emphasize_global(artifact_id), emphasize_global(version));
86 exit();
87 }
89 static Collection<String> process_pom(HttpClient client, Set<String> processed, String pom_url) {
90 if (processed.contains(pom_url))
91 return Collections.emptyList();
92 var request = HttpRequest.newBuilder().uri(URI.create(pom_url)).build();
93 return client.sendAsync(request, BodyHandlers.ofInputStream()).thenApply(input -> {
94 // TODO add pom to list of processed so that a pom only ever gets read once
95 processed.add(pom_url);
96 // TODO traverse path to root of poms and collect managed dependencies
97 // TODO collect declared dependencies from given pom
98 return List.<String>of();
99 }).join();
100 }
102 static void download_ressource(HttpClient client, Path target_directory, String ressource_url) {
103 var request = HttpRequest.newBuilder().uri(URI.create(ressource_url)).build();
104 var ressource_name = ressource_url.substring(ressource_url.lastIndexOf('/') + 1);
105 var target_ressource_path = target_directory.resolve(ressource_name);
106 client.sendAsync(request, BodyHandlers.ofFile(target_ressource_path)).join();
107 }
109 static String build_ressource_url(String base, String artifact_id, String version, String suffix) {
110 var url = new StringBuilder(base);
111 if (!base.endsWith("/"))
112 url.append('/');
113 url.append(artifact_id);
114 url.append('-');
115 url.append(version);
116 url.append(suffix);
117 return url.toString();
118 }
120 static String guess_maven_artifact_url(String base, String group_id, String artifact_id, String version) {
121 var url = new StringBuilder(base);
122 if (!base.endsWith("/"))
123 url.append('/');
124 url.append(group_id.replaceAll("\\.", "\\/"));
125 url.append('/');
126 url.append(artifact_id);
127 url.append('/');
128 url.append(version);
129 url.append('/');
130 return url.toString();
131 }
133 static class Dependency {
134 String artifactId;
135 String groupId;
136 String version;
137 String scope;
138 boolean optional;
139 }
141 static <T> int index_of(T[] array, T item) {
142 var length = array.length;
143 if (length == 0)
144 return -1;
145 for (var index = 0; index < length; ++index) {
146 var element = array[index];
147 if (Objects.equals(element, item))
148 return index;
149 }
150 return -1;
151 }
153 @SafeVarargs
154 static <T> boolean contains(T[] array, T... items) {
155 if (array.length == 0)
156 return false;
157 if (items.length == 0)
158 return false;
159 for (var element : array) {
160 for (var argument : items) {
161 if (element.equals(argument))
162 return true;
163 }
164 }
165 return false;
166 }
168 static void help() {
169 out.printf("Downloads an artifact from a %s repository with its %s.%n", emphasize_local("maven"),
170 emphasize_local("transitive dependencies"));
171 }
173 static void usage() {
174 out.printf("%s: java download_jar.java <group id> <artifact id> <version>%n", emphasize_global("Usage"));
175 }
177 static void exit() {
178 out.printf("%s!%n", emphasize_local("Done"));
179 System.exit(0);
180 }
182 static String emphasize_global(String message) {
183 return "\033[4m" + message + "\033[0m";
184 }
186 static String emphasize_local(String message) {
187 return "\033[3m" + message + "\033[0m";
188 }
190 static void fail(String message, Object... arguments) {
191 out.printf(message, arguments);
192 System.exit(-1);
193 }
195 static void fail() {
196 System.exit(-1);
197 }
198}
1import static java.lang.System.out;
2
3import java.io.*;
4import java.net.*;
5import java.net.http.*;
6import java.net.http.HttpResponse.*;
7import java.nio.file.*;
8import java.util.*;
9import java.util.concurrent.ConcurrentSkipListSet;
10
11class download_jar {
12 public static void main(final String[] command_line_arguments) {
13 help();
14 var current_working_directory = Paths.get(System.getProperty("user.dir"));
15 var download_directory = current_working_directory.resolve("downloaded_artifacts");
16 var maven_repository = "https://repo.maven.apache.org/maven2";
17 var expected_count_of_arguments = 3;
18 if (contains(command_line_arguments, "-d")) {
19 expected_count_of_arguments = expected_count_of_arguments + 2;
20 try {
21 var given_download_directory = command_line_arguments[index_of(command_line_arguments, "-d") + 1];
22 download_directory = current_working_directory.resolve(given_download_directory);
23 } catch (IndexOutOfBoundsException exception) {
24 out.println("The -d option requires an argument.");
25 usage();
26 fail();
27 }
28 }
29 if (contains(command_line_arguments, "-r")) {
30 expected_count_of_arguments = expected_count_of_arguments + 2;
31 try {
32 var given_maven_repository = command_line_arguments[index_of(command_line_arguments, "-r") + 1];
33 maven_repository = given_maven_repository;
34 } catch (IndexOutOfBoundsException exception) {
35 out.println("The -r option requires an argument.");
36 usage();
37 fail();
38 }
39 }
40 if (command_line_arguments.length != expected_count_of_arguments) {
41 usage();
42 fail();
43 }
44 var maven_coordinates_reversed = new String[3];
45 for (var index = 2; index >= 0; --index) {
46 maven_coordinates_reversed[index] = command_line_arguments[expected_count_of_arguments - index - 1];
47 }
48 var group_id = maven_coordinates_reversed[2];
49 var artifact_id = maven_coordinates_reversed[1];
50 var version = maven_coordinates_reversed[0];
51
52 if (Files.exists(download_directory) && Files.isRegularFile(download_directory)) {
53 fail("The given download directory path %s already points to a file!%n", download_directory.toString());
54 } else if (!Files.exists(download_directory)) {
55 out.printf("Creating directory at %s%n.", emphasize_global(download_directory.toString()));
56 try {
57 Files.createDirectories(download_directory);
58 } catch (IOException __) {
59 fail("Unable to create directory at %s", emphasize_global(download_directory.toString()));
60 }
61 }
62
63 var expected_artifact_base_url = guess_maven_artifact_url(maven_repository, group_id, artifact_id, version);
64 var client = HttpClient.newHttpClient();
65 var request = HttpRequest.newBuilder().uri(URI.create(expected_artifact_base_url)).build();
66 var target_directory = download_directory;
67 client.sendAsync(request, BodyHandlers.ofString()).thenApply(HttpResponse::statusCode).thenAccept(status -> {
68 if (status > 299) {
69 fail("Could not find maven artifact at %s.%n", expected_artifact_base_url);
70 } else {
71 download_ressource(client, target_directory,
72 build_ressource_url(expected_artifact_base_url, artifact_id, version, ".jar"));
73 download_ressource(client, target_directory,
74 build_ressource_url(expected_artifact_base_url, artifact_id, version, "-sources.jar"));
75 // FIXME BLOCKER! How do we implement the version clash resolution?
76 // Preferably in a manner that avoids pointless downloads...
77 var processed_cache = new ConcurrentSkipListSet<String>();
78 process_pom(client, processed_cache,
79 build_ressource_url(expected_artifact_base_url, artifact_id, version, ".pom"));
80 }
81 }).join();
82
83 out.printf("download directory:\t%s%nmaven repository:\t%s%nmaven coordinates:\t%s:%s:%s%n",
84 emphasize_global(download_directory.toString()), emphasize_global(maven_repository), emphasize_global(group_id),
85 emphasize_global(artifact_id), emphasize_global(version));
86 exit();
87 }
88
89 static Collection<String> process_pom(HttpClient client, Set<String> processed, String pom_url) {
90 if (processed.contains(pom_url))
91 return Collections.emptyList();
92 var request = HttpRequest.newBuilder().uri(URI.create(pom_url)).build();
93 return client.sendAsync(request, BodyHandlers.ofInputStream()).thenApply(input -> {
94 // TODO add pom to list of processed so that a pom only ever gets read once
95 processed.add(pom_url);
96 // TODO traverse path to root of poms and collect managed dependencies
97 // TODO collect declared dependencies from given pom
98 return List.<String>of();
99 }).join();
100 }
101
102 static void download_ressource(HttpClient client, Path target_directory, String ressource_url) {
103 var request = HttpRequest.newBuilder().uri(URI.create(ressource_url)).build();
104 var ressource_name = ressource_url.substring(ressource_url.lastIndexOf('/') + 1);
105 var target_ressource_path = target_directory.resolve(ressource_name);
106 client.sendAsync(request, BodyHandlers.ofFile(target_ressource_path)).join();
107 }
108
109 static String build_ressource_url(String base, String artifact_id, String version, String suffix) {
110 var url = new StringBuilder(base);
111 if (!base.endsWith("/"))
112 url.append('/');
113 url.append(artifact_id);
114 url.append('-');
115 url.append(version);
116 url.append(suffix);
117 return url.toString();
118 }
119
120 static String guess_maven_artifact_url(String base, String group_id, String artifact_id, String version) {
121 var url = new StringBuilder(base);
122 if (!base.endsWith("/"))
123 url.append('/');
124 url.append(group_id.replaceAll("\\.", "\\/"));
125 url.append('/');
126 url.append(artifact_id);
127 url.append('/');
128 url.append(version);
129 url.append('/');
130 return url.toString();
131 }
132
133 static class Dependency {
134 String artifactId;
135 String groupId;
136 String version;
137 String scope;
138 boolean optional;
139 }
140
141 static <T> int index_of(T[] array, T item) {
142 var length = array.length;
143 if (length == 0)
144 return -1;
145 for (var index = 0; index < length; ++index) {
146 var element = array[index];
147 if (Objects.equals(element, item))
148 return index;
149 }
150 return -1;
151 }
152
153 @SafeVarargs
154 static <T> boolean contains(T[] array, T... items) {
155 if (array.length == 0)
156 return false;
157 if (items.length == 0)
158 return false;
159 for (var element : array) {
160 for (var argument : items) {
161 if (element.equals(argument))
162 return true;
163 }
164 }
165 return false;
166 }
167
168 static void help() {
169 out.printf("Downloads an artifact from a %s repository with its %s.%n", emphasize_local("maven"),
170 emphasize_local("transitive dependencies"));
171 }
172
173 static void usage() {
174 out.printf("%s: java download_jar.java <group id> <artifact id> <version>%n", emphasize_global("Usage"));
175 }
176
177 static void exit() {
178 out.printf("%s!%n", emphasize_local("Done"));
179 System.exit(0);
180 }
181
182 static String emphasize_global(String message) {
183 return "\033[4m" + message + "\033[0m";
184 }
185
186 static String emphasize_local(String message) {
187 return "\033[3m" + message + "\033[0m";
188 }
189
190 static void fail(String message, Object... arguments) {
191 out.printf(message, arguments);
192 System.exit(-1);
193 }
194
195 static void fail() {
196 System.exit(-1);
197 }
198}

tools/git-info

Modified

+337 / −337 text lines

1#!/bin/sh
2#
3# git-info - shows information about a Git repository a la `svn info'
4#
5# How to use:
6# $ git info
7# $ git info ~/src/somewhere/somefile
8# $ git info some/relative/file_or_directory
9# $ git info ~/repos/something.git
10#
11# Copyright (c) 2009-2022 Akinori MUSHA
12#
13# All rights reserved.
14#
15# Redistribution and use in source and binary forms, with or without
16# modification, are permitted provided that the following conditions
17# are met:
18# 1. Redistributions of source code must retain the above copyright
19# notice, this list of conditions and the following disclaimer.
20# 2. Redistributions in binary form must reproduce the above copyright
21# notice, this list of conditions and the following disclaimer in the
22# documentation and/or other materials provided with the distribution.
23#
24# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
25# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
28# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34# SUCH DAMAGE.
35#
37COLOR=
39main () {
40 local opt
41 local OPTS_SPEC="\
42$0 [<options>] [<path>]
44$0 shows information about a Git repository.
45--
46h,help show the help
47color?when show colored output (always|never|auto)
48"
49 eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt --stuck-long -- "$@" || echo exit $?)"
51 while [ $# -gt 0 ]; do
52 opt="$1"
53 shift
55 case "$opt" in
56 --color)
57 COLOR=always
58 ;;
59 --color\=*)
60 COLOR="${opt#*=}"
61 ;;
62 --)
63 break
64 ;;
65 *)
66 die "Unexpected option: $opt"
67 ;;
68 esac
69 done
71 initialize_colors
73 case "$#" in
74 1)
75 ;;
76 0)
77 if [ -n "$GIT_DIR" ]; then
78 set -- "$GIT_DIR"
79 else
80 set -- .
81 fi
82 ;;
83 *)
84 die "Too many arguments"
85 ;;
86 esac
88 git_info "$1"
89}
91initialize_colors () {
92 if [ -z "$COLOR" ]; then
93 if git config --get-colorbool color.info; then
94 COLOR=always
95 else
96 COLOR=never
97 fi
98 fi
100 case "$COLOR" in
101 always|never)
102 COLOR_BRANCH=$COLOR
103 ;;
104 auto)
105 if git config --get-colorbool color.branch; then
106 COLOR_BRANCH=always
107 else
108 COLOR_BRANCH=never
109 fi
110 ;;
111 *)
112 die "option \`color' expects \"always\", \"auto\", or \"never\""
113 ;;
114 esac
116 if [ "$COLOR" = always ]; then
117 REMOTE_COLOR="$(get_color color.info.remote color.branch.remote red)"
118 LOCAL_COLOR="$(get_color color.info.local color.branch.local green)"
119 PATH_COLOR="$(get_color color.info.path '' 'bold')"
120 REPOSITORY_COLOR="$(get_color color.info.repository '' 'bold')"
121 ID_COLOR="$(get_color color.info.id '' 'yellow')"
122 RESET_COLOR=$(printf "\033[m")
123 else
124 REMOTE_COLOR=
125 LOCAL_COLOR=
126 PATH_COLOR=
127 REPOSITORY_COLOR=
128 ID_COLOR=
129 RESET_COLOR=
130 fi
131}
133get_color () {
134 local key1="$1" key2="$2" fb="$3"
135 local color="$(git config --get-color "$key1" '')"
136 case "$color" in
137 ''|'')
138 git config --get-color "$key2" "$fb"
139 ;;
140 *)
141 printf '%s' "$color"
142 ;;
143 esac
144}
146git_info () {
147 local path="$1" dir relpath root git_dir
149 if [ -d "$path" ]; then
150 dir="$(cd -P "$path" && pwd)" || die "$path: Cannot cd to the directory"
151 case "$path" in
152 *.git)
153 git_dir="$dir"
154 ;;
155 esac
156 elif [ -f "$path" ]; then
157 dir="$(dirname "$path")"
158 dir="$(cd -P "$dir" && pwd)" || die "$dir: Cannot cd to the directory"
159 relpath="$(basename "$path")"
160 else
161 die "$path: No such file or directory"
162 fi
164 if [ -n "$git_dir" ]; then
165 dir=
166 relpath=
167 elif case "$dir" in ?*.git) [ -d "$dir/objects" -a -d "$dir/refs" ] ;; *) false ;; esac; then
168 git_dir="$dir"
169 relpath=
170 else
171 root="$(
172 cd "$dir" || exit 1
173 while [ ! -e .git ]; do
174 [ "$(pwd)" = / ] && exit 1
175 cd ..
176 done
177 pwd
178 )" || die "Not a git repository."
179 git_dir="$root/.git"
180 if [ "$dir" = "$root" ]; then
181 relpath=.
182 elif [ -n "$relpath" ]; then
183 relpath="${dir#"$root/"}/$relpath"
184 else
185 relpath="${dir#"$root/"}"
186 fi
187 fi
189 set -- "$git_dir"
190 if [ -n "$relpath" ]; then
191 set -- "$@" "$relpath"
192 fi
194 do_git_info "$@"
195}
197do_git_info () {
198 local git_dir="$1" relpath="$2" root line field color reset
200 shift
202 echo "Repository Path: $PATH_COLOR$git_dir$RESET_COLOR"
204 if [ $# -gt 0 ]; then
205 root="$(dirname "$git_dir")"
206 if [ "$relpath" = . ]; then
207 echo "Path: $PATH_COLOR$root$RESET_COLOR"
208 else
209 echo "Path: $PATH_COLOR$root/$relpath$RESET_COLOR"
210 fi
211 fi
213 maketemp
215 GIT_DIR="$git_dir" git remote -v > "$TEMPFILE"
216 if [ -s "$TEMPFILE" ]; then
217 echo "Remote Repositories:"
218 sed -e "s/^\([^ ]\{1,\}\)\([ ]\{1,\}\)\([^ ]\{1,\}\)/$REMOTE_COLOR\1$RESET_COLOR\2$REPOSITORY_COLOR\3$RESET_COLOR/" \
219 -e 's/^/ /' \
220 "$TEMPFILE"
221 fi
223 GIT_DIR="$git_dir" git branch -r --color=$COLOR_BRANCH > "$TEMPFILE"
224 if [ -s "$TEMPFILE" ]; then
225 echo "Remote Branches:"
226 sed -e "s/\([ ]\{1,\}->[ ]\{1,\}\)\([^ ]\{1,\}\)/\1$REMOTE_COLOR\2$RESET_COLOR/" \
227 -e 's/^ */ /' "$TEMPFILE"
228 fi
230 GIT_DIR="$git_dir" git branch --color=$COLOR_BRANCH > "$TEMPFILE"
231 if [ -s "$TEMPFILE" ]; then
232 echo "Local Branches:"
233 sed 's/^/ /' "$TEMPFILE"
234 fi
236 echo "Repository Configuration:"
237 GIT_DIR="$git_dir" git config --local --list | sort | {
238 prev_section=
239 prev_subsection=
240 while read line; do
241 case "$line" in
242 (*=*)
243 lhs=$(expr "$line" : '\([^=]\{1,\}\)')
244 rhs=$(expr "$line" : '[^=]\{1,\}=\(.*\)')
245 case "$lhs" in
246 (?*.?*.?*)
247 section=$(expr "$lhs" : '\([^.]\{1,\}\)')
248 subsection=$(expr "$lhs" : '[^.]\{1,\}\.\(.\{1,\}\)\.')
249 key=$(expr "$lhs" : '[^.]\{1,\}\..\{1,\}\.\([^.]\{0,\}\)$')
250 if [ "$section" != "$prev_section" -o "$subsection" != "$prev_subsection" ]; then
251 prev_section=$section
252 prev_subsection=$subsection
253 case "$section" in
254 (remote)
255 subsection=$REMOTE_COLOR$subsection$RESET_COLOR
256 ;;
257 (branch)
258 subsection=$LOCAL_COLOR$subsection$RESET_COLOR
259 esac
260 printf "\t[%s \"%s\"]\n" "$section" "$subsection"
261 fi
262 case "$section" in
263 (remote)
264 if [ "$key" = url ]; then
265 rhs=$REPOSITORY_COLOR$rhs$RESET_COLOR
266 fi
267 ;;
268 (branch)
269 if [ "$key" = remote ]; then
270 rhs=$REMOTE_COLOR$rhs$RESET_COLOR
271 fi
272 esac
273 printf "\t\t%s = %s\n" "$key" "$rhs"
274 ;;
275 (?*.?*)
276 section=$(expr "$lhs" : '\([^.]\{1,\}\)')
277 key=$(expr "$lhs" : '[^.]\{1,\}\.\([^.]\{1,\}\)$')
278 if [ "$section" != "$prev_section" -o -n "$prev_subsection" ]; then
279 prev_section=$section
280 prev_subsection=
281 printf "\t[%s]\n" "$section"
282 fi
283 printf "\t\t$key = $rhs\n"
284 ;;
285 (*)
286 esac
287 esac
288 done
289 }
291 (cd "$root" && GIT_DIR="$git_dir" git log --max-count=1 "$@") | {
292 while read -r field line; do
293 color=
294 reset=
295 case "$field" in
296 commit)
297 field='Commit ID:'
298 color="$ID_COLOR"
299 reset="$RESET_COLOR"
300 ;;
301 *:)
302 ;;
303 '')
304 break
305 ;;
306 esac
307 echo "Last Changed $field $color$line$reset"
308 done
309 cat > "$TEMPFILE"
310 }
311 echo "Last Changed Log:"
312 sed 's/^ / /' "$TEMPFILE"
314 finalize
315}
317die () {
318 [ "$#" -gt 0 ] && echo "$0: $@" >&2
319 finalize
320 exit 1
321}
323TEMPFILE=
325maketemp () {
326 if [ -z "$TEMPFILE" ]; then
327 TEMPFILE="$(mktemp /tmp/git-info.XXXXXX)" || die
328 trap "finalize; exit 130" 1 2 3 15
329 fi
330}
332finalize () {
333 if [ -n "$TEMPFILE" ]; then
334 rm -f "$TEMPFILE"
335 fi
336}
1#!/bin/sh
2#
3# git-info - shows information about a Git repository a la `svn info'
4#
5# How to use:
6# $ git info
7# $ git info ~/src/somewhere/somefile
8# $ git info some/relative/file_or_directory
9# $ git info ~/repos/something.git
10#
11# Copyright (c) 2009-2022 Akinori MUSHA
12#
13# All rights reserved.
14#
15# Redistribution and use in source and binary forms, with or without
16# modification, are permitted provided that the following conditions
17# are met:
18# 1. Redistributions of source code must retain the above copyright
19# notice, this list of conditions and the following disclaimer.
20# 2. Redistributions in binary form must reproduce the above copyright
21# notice, this list of conditions and the following disclaimer in the
22# documentation and/or other materials provided with the distribution.
23#
24# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
25# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
28# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34# SUCH DAMAGE.
35#
36
37COLOR=
38
39main () {
40 local opt
41 local OPTS_SPEC="\
42$0 [<options>] [<path>]
43
44$0 shows information about a Git repository.
45--
46h,help show the help
47color?when show colored output (always|never|auto)
48"
49 eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt --stuck-long -- "$@" || echo exit $?)"
50
51 while [ $# -gt 0 ]; do
52 opt="$1"
53 shift
54
55 case "$opt" in
56 --color)
57 COLOR=always
58 ;;
59 --color\=*)
60 COLOR="${opt#*=}"
61 ;;
62 --)
63 break
64 ;;
65 *)
66 die "Unexpected option: $opt"
67 ;;
68 esac
69 done
70
71 initialize_colors
72
73 case "$#" in
74 1)
75 ;;
76 0)
77 if [ -n "$GIT_DIR" ]; then
78 set -- "$GIT_DIR"
79 else
80 set -- .
81 fi
82 ;;
83 *)
84 die "Too many arguments"
85 ;;
86 esac
87
88 git_info "$1"
89}
90
91initialize_colors () {
92 if [ -z "$COLOR" ]; then
93 if git config --get-colorbool color.info; then
94 COLOR=always
95 else
96 COLOR=never
97 fi
98 fi
99
100 case "$COLOR" in
101 always|never)
102 COLOR_BRANCH=$COLOR
103 ;;
104 auto)
105 if git config --get-colorbool color.branch; then
106 COLOR_BRANCH=always
107 else
108 COLOR_BRANCH=never
109 fi
110 ;;
111 *)
112 die "option \`color' expects \"always\", \"auto\", or \"never\""
113 ;;
114 esac
115
116 if [ "$COLOR" = always ]; then
117 REMOTE_COLOR="$(get_color color.info.remote color.branch.remote red)"
118 LOCAL_COLOR="$(get_color color.info.local color.branch.local green)"
119 PATH_COLOR="$(get_color color.info.path '' 'bold')"
120 REPOSITORY_COLOR="$(get_color color.info.repository '' 'bold')"
121 ID_COLOR="$(get_color color.info.id '' 'yellow')"
122 RESET_COLOR=$(printf "\033[m")
123 else
124 REMOTE_COLOR=
125 LOCAL_COLOR=
126 PATH_COLOR=
127 REPOSITORY_COLOR=
128 ID_COLOR=
129 RESET_COLOR=
130 fi
131}
132
133get_color () {
134 local key1="$1" key2="$2" fb="$3"
135 local color="$(git config --get-color "$key1" '')"
136 case "$color" in
137 ''|'')
138 git config --get-color "$key2" "$fb"
139 ;;
140 *)
141 printf '%s' "$color"
142 ;;
143 esac
144}
145
146git_info () {
147 local path="$1" dir relpath root git_dir
148
149 if [ -d "$path" ]; then
150 dir="$(cd -P "$path" && pwd)" || die "$path: Cannot cd to the directory"
151 case "$path" in
152 *.git)
153 git_dir="$dir"
154 ;;
155 esac
156 elif [ -f "$path" ]; then
157 dir="$(dirname "$path")"
158 dir="$(cd -P "$dir" && pwd)" || die "$dir: Cannot cd to the directory"
159 relpath="$(basename "$path")"
160 else
161 die "$path: No such file or directory"
162 fi
163
164 if [ -n "$git_dir" ]; then
165 dir=
166 relpath=
167 elif case "$dir" in ?*.git) [ -d "$dir/objects" -a -d "$dir/refs" ] ;; *) false ;; esac; then
168 git_dir="$dir"
169 relpath=
170 else
171 root="$(
172 cd "$dir" || exit 1
173 while [ ! -e .git ]; do
174 [ "$(pwd)" = / ] && exit 1
175 cd ..
176 done
177 pwd
178 )" || die "Not a git repository."
179 git_dir="$root/.git"
180 if [ "$dir" = "$root" ]; then
181 relpath=.
182 elif [ -n "$relpath" ]; then
183 relpath="${dir#"$root/"}/$relpath"
184 else
185 relpath="${dir#"$root/"}"
186 fi
187 fi
188
189 set -- "$git_dir"
190 if [ -n "$relpath" ]; then
191 set -- "$@" "$relpath"
192 fi
193
194 do_git_info "$@"
195}
196
197do_git_info () {
198 local git_dir="$1" relpath="$2" root line field color reset
199
200 shift
201
202 echo "Repository Path: $PATH_COLOR$git_dir$RESET_COLOR"
203
204 if [ $# -gt 0 ]; then
205 root="$(dirname "$git_dir")"
206 if [ "$relpath" = . ]; then
207 echo "Path: $PATH_COLOR$root$RESET_COLOR"
208 else
209 echo "Path: $PATH_COLOR$root/$relpath$RESET_COLOR"
210 fi
211 fi
212
213 maketemp
214
215 GIT_DIR="$git_dir" git remote -v > "$TEMPFILE"
216 if [ -s "$TEMPFILE" ]; then
217 echo "Remote Repositories:"
218 sed -e "s/^\([^ ]\{1,\}\)\([ ]\{1,\}\)\([^ ]\{1,\}\)/$REMOTE_COLOR\1$RESET_COLOR\2$REPOSITORY_COLOR\3$RESET_COLOR/" \
219 -e 's/^/ /' \
220 "$TEMPFILE"
221 fi
222
223 GIT_DIR="$git_dir" git branch -r --color=$COLOR_BRANCH > "$TEMPFILE"
224 if [ -s "$TEMPFILE" ]; then
225 echo "Remote Branches:"
226 sed -e "s/\([ ]\{1,\}->[ ]\{1,\}\)\([^ ]\{1,\}\)/\1$REMOTE_COLOR\2$RESET_COLOR/" \
227 -e 's/^ */ /' "$TEMPFILE"
228 fi
229
230 GIT_DIR="$git_dir" git branch --color=$COLOR_BRANCH > "$TEMPFILE"
231 if [ -s "$TEMPFILE" ]; then
232 echo "Local Branches:"
233 sed 's/^/ /' "$TEMPFILE"
234 fi
235
236 echo "Repository Configuration:"
237 GIT_DIR="$git_dir" git config --local --list | sort | {
238 prev_section=
239 prev_subsection=
240 while read line; do
241 case "$line" in
242 (*=*)
243 lhs=$(expr "$line" : '\([^=]\{1,\}\)')
244 rhs=$(expr "$line" : '[^=]\{1,\}=\(.*\)')
245 case "$lhs" in
246 (?*.?*.?*)
247 section=$(expr "$lhs" : '\([^.]\{1,\}\)')
248 subsection=$(expr "$lhs" : '[^.]\{1,\}\.\(.\{1,\}\)\.')
249 key=$(expr "$lhs" : '[^.]\{1,\}\..\{1,\}\.\([^.]\{0,\}\)$')
250 if [ "$section" != "$prev_section" -o "$subsection" != "$prev_subsection" ]; then
251 prev_section=$section
252 prev_subsection=$subsection
253 case "$section" in
254 (remote)
255 subsection=$REMOTE_COLOR$subsection$RESET_COLOR
256 ;;
257 (branch)
258 subsection=$LOCAL_COLOR$subsection$RESET_COLOR
259 esac
260 printf "\t[%s \"%s\"]\n" "$section" "$subsection"
261 fi
262 case "$section" in
263 (remote)
264 if [ "$key" = url ]; then
265 rhs=$REPOSITORY_COLOR$rhs$RESET_COLOR
266 fi
267 ;;
268 (branch)
269 if [ "$key" = remote ]; then
270 rhs=$REMOTE_COLOR$rhs$RESET_COLOR
271 fi
272 esac
273 printf "\t\t%s = %s\n" "$key" "$rhs"
274 ;;
275 (?*.?*)
276 section=$(expr "$lhs" : '\([^.]\{1,\}\)')
277 key=$(expr "$lhs" : '[^.]\{1,\}\.\([^.]\{1,\}\)$')
278 if [ "$section" != "$prev_section" -o -n "$prev_subsection" ]; then
279 prev_section=$section
280 prev_subsection=
281 printf "\t[%s]\n" "$section"
282 fi
283 printf "\t\t$key = $rhs\n"
284 ;;
285 (*)
286 esac
287 esac
288 done
289 }
290
291 (cd "$root" && GIT_DIR="$git_dir" git log --max-count=1 "$@") | {
292 while read -r field line; do
293 color=
294 reset=
295 case "$field" in
296 commit)
297 field='Commit ID:'
298 color="$ID_COLOR"
299 reset="$RESET_COLOR"
300 ;;
301 *:)
302 ;;
303 '')
304 break
305 ;;
306 esac
307 echo "Last Changed $field $color$line$reset"
308 done
309 cat > "$TEMPFILE"
310 }
311 echo "Last Changed Log:"
312 sed 's/^ / /' "$TEMPFILE"
313
314 finalize
315}
316
317die () {
318 [ "$#" -gt 0 ] && echo "$0: $@" >&2
319 finalize
320 exit 1
321}
322
323TEMPFILE=
324
325maketemp () {
326 if [ -z "$TEMPFILE" ]; then
327 TEMPFILE="$(mktemp /tmp/git-info.XXXXXX)" || die
328 trap "finalize; exit 130" 1 2 3 15
329 fi
330}
331
332finalize () {
333 if [ -n "$TEMPFILE" ]; then
334 rm -f "$TEMPFILE"
335 fi
336}
337
338338main "$@"No final newline

tools/gnome-settings.nu

Modified

+17 / −17 text lines

1#!/usr/bin/env nu
2
3def main [] {
4 const background_settings = [
5 ['key', 'value'];
6 ['picture-uri', 'none']
7 ['color-shading-type', 'solid']
8 ['primary-color', '#131313']
9 ['secondary-color', '#131313']
10 ]
12 $background_settings | each { | setting |
13 run-external gsettings set 'org.gnome.desktop.background' $setting.key $setting.value
14 }
16 null
17}
1#!/usr/bin/env nu
2
3def main [] {
4 const background_settings = [
5 ['key', 'value'];
6 ['picture-uri', 'none']
7 ['color-shading-type', 'solid']
8 ['primary-color', '#131313']
9 ['secondary-color', '#131313']
10 ]
11
12 $background_settings | each { | setting |
13 run-external gsettings set 'org.gnome.desktop.background' $setting.key $setting.value
14 }
15
16 null
17}

tools/install.java

Modified

+146 / −146 text lines

1import static java.lang.System.out;
2import static java.lang.System.err;
3
4import java.nio.file.Files;
5import java.nio.file.Path;
6import java.nio.file.Paths;
7import java.util.Arrays;
8
9final class install {
10 // TODO: platform key in die csv, um os zu unterscheiden.
11 static final String CARGO_PACKAGES_CSV_FILE = "tools.csv";
13 public static void main(String[] __)
14 throws Throwable {
15 exec("cargo", "--version");
17 var csv = Path.of(CARGO_PACKAGES_CSV_FILE);
18 if (!Files.exists(csv)) {
19 throw fail("Expected a CSV file with cargo crates!");
20 }
22 var lines = Files.lines(csv).toArray(String[]::new);
23 for (int index = 1; index < lines.length; ++index) {
24 var line = lines[index];
25 var spec = parse(line);
26 if (spec != null && !which(spec.bin)) {
27 install(spec);
28 }
29 }
30 }
32 static boolean which(String program) {
33 var pathEnv = System.getenv("PATH");
35 if (pathEnv == null || pathEnv.isEmpty()) {
36 return false;
37 }
39 var paths = pathEnv.split(System.getProperty("path.separator"));
40 var extensions = new String[] { "", ".exe", ".bat", ".cmd", ".com" };
42 for (var path : paths) {
43 for (var extension : extensions) {
44 var fullPath = Paths.get(path, program + extension);
45 if (Files.exists(fullPath) && Files.isExecutable(fullPath)) {
46 return true;
47 }
48 }
49 }
51 return false;
52 }
54 static void exec(String... command)
55 throws Throwable {
56 var proc = new ProcessBuilder(command).inheritIO().start();
57 proc.waitFor();
58 var exit = proc.exitValue();
59 if (exit != 0) {
60 throw fail("process failed to exec with code %d.%nproc: %s", exit, emphasize_local(Arrays.toString(command)));
61 }
62 }
64 static void install(Spec spec)
65 throws Throwable {
66 out("cargo install %s (%s) %s",
67 emphasize_global(spec.name),
68 emphasize_local(spec.bin),
69 emphasize_local(Arrays.toString(spec.flags)));
71 var cmd = new String[3 + spec.flags.length];
72 cmd[0] = "cargo";
73 cmd[1] = "install";
74 cmd[2] = spec.name;
76 System.arraycopy(spec.flags, 0, cmd, 3, spec.flags.length);
78 exec(cmd);
79 }
81 record Spec(String name, String bin, String... flags) {
82 };
84 static Spec parse(String line)
85 throws Throwable {
86 if (line.startsWith("#"))
87 {
88 return null;
89 }
90 var by_comma = line.split(";");
91 if (by_comma.length == 0) {
92 throw fail("empty line in CSV");
93 }
94 if (by_comma.length > 3) {
95 throw fail("line in CSV should have 1-3 fields%nfound: %s", emphasize_local(line));
96 }
97 var name = by_comma[0].strip();
98 var bin = name;
99 if (by_comma.length > 1) {
100 bin = by_comma[1].strip();
101 }
102 var flags = new String[] {};
103 if (by_comma.length == 3) {
104 flags = by_comma[2].strip().split(" ");
105 }
106 return new Spec(name, bin, flags);
107 }
109 static void out(String fmt, Object... args) {
110 out.printf(fmt, args);
111 out.println();
112 }
114 static void dbg(String fmt, Object... args) {
115 System.err.print("[DBG]: ");
116 System.err.printf(fmt, args);
117 System.err.println();
118 }
120 static Throwable exit() {
121 System.exit(0);
122 // abuse control flow to make compiler realize `exit` will never return
123 return new Throwable();
124 }
126 static String emphasize_global(String message) {
127 return "\033[4m" + message + "\033[0m";
128 }
130 static String emphasize_local(String message) {
131 return "\033[3m" + message + "\033[0m";
132 }
134 static Throwable fail(String message, Object... arguments) {
135 err.printf(message, arguments);
136 System.exit(-1);
137 // abuse control flow to make compiler realize `fail` will never return
138 return new Throwable();
139 }
141 static Throwable fail() {
142 System.exit(-1);
143 // abuse control flow to make compiler realize `fail` will never return
144 return new Throwable();
145 }
146}
1import static java.lang.System.out;
2import static java.lang.System.err;
3
4import java.nio.file.Files;
5import java.nio.file.Path;
6import java.nio.file.Paths;
7import java.util.Arrays;
8
9final class install {
10 // TODO: platform key in die csv, um os zu unterscheiden.
11 static final String CARGO_PACKAGES_CSV_FILE = "crates.csv";
12
13 public static void main(String[] __)
14 throws Throwable {
15 exec("cargo", "--version");
16
17 var csv = Path.of(CARGO_PACKAGES_CSV_FILE);
18 if (!Files.exists(csv)) {
19 throw fail("Expected a CSV file with cargo crates!");
20 }
21
22 var lines = Files.lines(csv).toArray(String[]::new);
23 for (int index = 1; index < lines.length; ++index) {
24 var line = lines[index];
25 var spec = parse(line);
26 if (spec != null && !which(spec.bin)) {
27 install(spec);
28 }
29 }
30 }
31
32 static boolean which(String program) {
33 var pathEnv = System.getenv("PATH");
34
35 if (pathEnv == null || pathEnv.isEmpty()) {
36 return false;
37 }
38
39 var paths = pathEnv.split(System.getProperty("path.separator"));
40 var extensions = new String[] { "", ".exe", ".bat", ".cmd", ".com" };
41
42 for (var path : paths) {
43 for (var extension : extensions) {
44 var fullPath = Paths.get(path, program + extension);
45 if (Files.exists(fullPath) && Files.isExecutable(fullPath)) {
46 return true;
47 }
48 }
49 }
50
51 return false;
52 }
53
54 static void exec(String... command)
55 throws Throwable {
56 var proc = new ProcessBuilder(command).inheritIO().start();
57 proc.waitFor();
58 var exit = proc.exitValue();
59 if (exit != 0) {
60 throw fail("process failed to exec with code %d.%nproc: %s", exit, emphasize_local(Arrays.toString(command)));
61 }
62 }
63
64 static void install(Spec spec)
65 throws Throwable {
66 out("cargo install %s (%s) %s",
67 emphasize_global(spec.name),
68 emphasize_local(spec.bin),
69 emphasize_local(Arrays.toString(spec.flags)));
70
71 var cmd = new String[3 + spec.flags.length];
72 cmd[0] = "cargo";
73 cmd[1] = "install";
74 cmd[2] = spec.name;
75
76 System.arraycopy(spec.flags, 0, cmd, 3, spec.flags.length);
77
78 exec(cmd);
79 }
80
81 record Spec(String name, String bin, String... flags) {
82 };
83
84 static Spec parse(String line)
85 throws Throwable {
86 if (line.startsWith("#"))
87 {
88 return null;
89 }
90 var by_comma = line.split(";");
91 if (by_comma.length == 0) {
92 throw fail("empty line in CSV");
93 }
94 if (by_comma.length > 3) {
95 throw fail("line in CSV should have 1-3 fields%nfound: %s", emphasize_local(line));
96 }
97 var name = by_comma[0].strip();
98 var bin = name;
99 if (by_comma.length > 1) {
100 bin = by_comma[1].strip();
101 }
102 var flags = new String[] {};
103 if (by_comma.length == 3) {
104 flags = by_comma[2].strip().split(" ");
105 }
106 return new Spec(name, bin, flags);
107 }
108
109 static void out(String fmt, Object... args) {
110 out.printf(fmt, args);
111 out.println();
112 }
113
114 static void dbg(String fmt, Object... args) {
115 System.err.print("[DBG]: ");
116 System.err.printf(fmt, args);
117 System.err.println();
118 }
119
120 static Throwable exit() {
121 System.exit(0);
122 // abuse control flow to make compiler realize `exit` will never return
123 return new Throwable();
124 }
125
126 static String emphasize_global(String message) {
127 return "\033[4m" + message + "\033[0m";
128 }
129
130 static String emphasize_local(String message) {
131 return "\033[3m" + message + "\033[0m";
132 }
133
134 static Throwable fail(String message, Object... arguments) {
135 err.printf(message, arguments);
136 System.exit(-1);
137 // abuse control flow to make compiler realize `fail` will never return
138 return new Throwable();
139 }
140
141 static Throwable fail() {
142 System.exit(-1);
143 // abuse control flow to make compiler realize `fail` will never return
144 return new Throwable();
145 }
146}

tools/packages.nu

Added
new file mode 100644

+195 / −0 text lines

1let OS = sys host | get name
2
3def main [] {
4 let install_path = $env.TOOLS | path join bin
5 let cache_path = make-cache-path 'net.bugabinga.packages'
6 let packages = open 'packages.nuon'
7
8 install-packages $install_path $cache_path $packages
9 null
10}
11
12def make-cache-path [
13 name: string # application name, for which to generate a stable system location for cache files
14] {
15 let os = sys host | get name
16 let system_location = if $OS =~ "Windows" {
17 $env.LOCALAPPDATA
18 } else if $os =~ "Linux" {
19 $env | get-or-else XDG_CACHE_HOME ($env.HOME | path join .cache)
20 } else {
21 error make {
22 msg: "unsupported operating system detected! initialising self destruct sequence..."
23 }
24 }
25 let cache_path = $system_location | path join $name
26 mkdir $cache_path
27 $cache_path
28}
29
30# Gets value of a column, or falls back to given alternative value.
31#
32def get-or-else [
33 column: string # name of the column to get its value from
34 value: any # alternative value to return, in case `get` gets nothing
35]: [
36 record -> any
37 table -> any
38] {
39 select -i $column | update $column { if ( $in | is-empty ) { $value } else { $in } } | get $column
40}
41
42def install-packages [
43 install_path: path # path where to install packages to
44 cache_path: path # path where to cache downloaded packed in
45 packages: list<any> # packages to install
46] {
47 $packages | par-each {
48 | package |
49 if ($package | is-installed-in $install_path $cache_path) {
50 print $"Package ($package.name) is already installed."
51 } else {
52 let artifact = download-package $package $cache_path
53 if $artifact == null {
54 print $'Package ($package.name) is not available for current operating system. Skipping it!'
55 return
56 }
57 let executable = unpack-executable $package $artifact
58 install-executable $package $executable $install_path
59 }
60 }
61}
62
63def download-package [
64 package: record # package specification
65 cache: path # cache path for packages
66] {
67 let artifact_path = make-artifact-path $package $cache
68 if ($artifact_path | path exists) {
69 return $artifact_path
70 } else {
71 mkdir ($artifact_path | path dirname)
72 let url = make-url? $package
73 http get --raw --max-time 30sec $url | save --progress --raw $artifact_path
74 return $artifact_path
75 }
76}
77
78def make-url? [
79 package: record # package specification
80] {
81 let url_format = match $OS {
82 "Windows" => { $package.win32_url }
83 "Linux" => { $package.lnx_url }
84 _ => { error make { msg: "unknown operating system" } }
85 }
86 if $url_format == null {
87 return null
88 }
89 $url_format | str replace --all --regex '\{\s*version\s*\}' $package.version
90}
91
92def make-artifact-path [
93 package: record # package specification
94 cache: path # cache path for packages
95] {
96 let url = make-url? $package
97 let artifact_parent_path = [ $cache $package.name ] | path join
98 let extension = $url | url parse | get path | get-extension
99 ($artifact_parent_path | path join $package.version) + "." + $extension
100}
101
102def get-extension []: path -> string {
103 let path = $in | path parse
104 if ($path.stem | str ends-with '.tar') {
105 return ('tar.' + $path.extension)
106 } else {
107 return $path.extension
108 }
109}
110
111def unpack-executable [
112 package: record # package specification
113 artifact: path # archive or executable
114] {
115 if ($artifact | is-archive ) {
116 let tmpdir = mktemp --directory --tmpdir 'net.bugabinga.packages.XXXXXX'
117 run-external ouch '--quiet' decompress '--dir' $tmpdir $artifact
118 let exe_glob = '(?i)' + $'($tmpdir)/**/*($package.binary)*' | str replace --all '\' '/' | str replace ':' '\:'
119 let executable = glob --no-dir --no-symlink $exe_glob |
120 filter { is-executable } |
121 first
122 return $executable
123
124 } else if ($artifact | is-executable) {
125 let tmpdir = mktemp --directory --tmpdir 'net.bugabinga.packages.XXXXXX'
126 cp $artifact $tmpdir
127 let copy = [ $tmpdir ($artifact | path basename)] | path join
128 return $copy
129 } else {
130 error make {
131 msg: "unknown package type"
132 label: {
133 text: "trying to unpack this artifact failed"
134 span: (metadata $artifact).span
135 }
136 }
137 }
138}
139
140def is-archive []: path -> bool {
141 let magic_headers = [
142 0x[FD 37 7A 58 5A 00] # xz
143 0x[50 4B] # ZIP
144 0x[1F 8B] # gzip
145 0x[75 73 74 61 72] # tar
146 ]
147 $in | is-magic-file $magic_headers
148}
149
150def is-executable []: path -> bool {
151 let magic_headers = [
152 0x[7F 45 4C 46] # elf
153 0x[4D 5A] # DOS MZ
154 ]
155 $in | is-magic-file $magic_headers
156}
157
158def is-magic-file [
159 magic_headers: list<binary> # list of magic headers to check file against
160]: path -> bool {
161 let max_size = $magic_headers | each { length } | math max
162 let header = open $in | into binary | first $max_size
163 $magic_headers | any { |magic| $header | bytes starts-with $magic }
164}
165
166def install-executable [
167 package: record # package specification
168 executable: path # path to an executable to install
169 installs: path # path to all installed packages
170] {
171 let target = make-target-path $package $installs
172 mv --interactive --verbose --update $executable $target
173}
174
175def is-installed-in [
176 installs: path # path to all installed packages
177 cache: path # path to cache of all packages
178]: record -> bool {
179 let package = $in
180 let is_installed = make-target-path $package $installs | path exists
181 let is_cached = make-artifact-path $package $cache | path exists
182 $is_installed and $is_cached
183}
184
185def make-target-path [
186 package: record # package specification
187 installs: path # path to all installed packages
188] {
189 let target = $installs | path join ($package | get binary | to-executable-name)
190 return $target
191}
192
193def to-executable-name []: string -> string {
194 [ $in (if $OS =~ "Windows" { '.exe' } else { '' } ) ] | str join
195}

tools/packages.nuon

Added
new file mode 100644

+52 / −0 text lines

1[
2 [name binary version win32_url lnx_url];
3 [
4 ouch
5 ouch
6 0.5.1
7 https://github.com/ouch-org/ouch/releases/download/{ version }/ouch-x86_64-pc-windows-msvc.zip
8 https://github.com/ouch-org/ouch/releases/download/{ version }/ouch-x86_64-unknown-linux-musl.tar.gz
9 ],
10 [
11 heatseaker
12 hs
13 1.7.2
14 https://github.com/rschmitt/heatseeker/releases/download/v{ version }/heatseeker-v{ version }-x86_64-pc-windows-msvc.zip
15 https://github.com/rschmitt/heatseeker/releases/download/v{ version }/heatseeker-v{ version }-x86_64-unknown-linux-musl.tar.gz
16 ],
17 [
18 ijq
19 ijq
20 1.1.2
21 https://git.sr.ht/~gpanders/ijq/refs/download/v{ version }/ijq-{ version }-windows-amd64.tar.gz
22 https://git.sr.ht/~gpanders/ijq/refs/download/v{ version }/ijq-{ version }-linux-amd64.tar.gz
23 ],
24 [
25 spoon
26 spoon
27 0.0.9
28 https://github.com/Bios-Marcel/spoon/releases/download/v{ version }/spoon.exe
29 null
30 ],
31 [
32 ttyper
33 ttyper
34 1.6.0
35 https://github.com/max-niederman/ttyper/releases/download/v{ version }/ttyper-x86_64-pc-windows-msvc.zip
36 https://github.com/max-niederman/ttyper/releases/download/v{ version }/ttyper-x86_64-unknown-linux-musl.tar.gz
37 ],
38 [
39 tree-sitter
40 tree-sitter
41 0.24.4
42 https://github.com/tree-sitter/tree-sitter/releases/download/v{ version }/tree-sitter-windows-x64.gz
43 https://github.com/tree-sitter/tree-sitter/releases/download/v{ version }/tree-sitter-linux-x64.gz
44 ],
45 [
46 win32yank
47 win32yank
48 0.1.1
49 https://github.com/equalsraf/win32yank/releases/download/v{ version }/win32yank-x64.zip
50 null
51 ],
52]

tools/rbwsearch

Modified

+32 / −32 text lines

1#!/bin/bash
2
3rbwsearch() {
4 SEARCH_ARGS=()
5 RBW_ARGS=()
6
7 while [[ $# -gt 0 ]]; do
8 case $1 in
9 -f|--field)
10 RBW_ARGS+=("$1" "$2")
11 shift
12 shift
13 ;;
14 -*)
15 RBW_ARGS+=("$1")
16 shift
17 ;;
18 *)
19 SEARCH_ARGS+=("$1")
20 shift
21 ;;
22 esac
23 done
24 rbw unlocked || rbw unlock || return
25 IFS=$'\t' read -r NAME FOLDER < <(rbw list --fields name,folder|sk -q "${SEARCH_ARGS[*]}")
26 if [ -n "$FOLDER" ]; then
27 RBW_ARGS+=("--folder" "$FOLDER")
28 fi
29 rbw get --clipboard "${RBW_ARGS[@]}" "$NAME"
30}
32rbwsearch $@
1#!/bin/bash
2
3rbwsearch() {
4 SEARCH_ARGS=()
5 RBW_ARGS=()
6
7 while [[ $# -gt 0 ]]; do
8 case $1 in
9 -f|--field)
10 RBW_ARGS+=("$1" "$2")
11 shift
12 shift
13 ;;
14 -*)
15 RBW_ARGS+=("$1")
16 shift
17 ;;
18 *)
19 SEARCH_ARGS+=("$1")
20 shift
21 ;;
22 esac
23 done
24 rbw unlocked || rbw unlock || return
25 IFS=$'\t' read -r NAME FOLDER < <(rbw list --fields name,folder|sk -q "${SEARCH_ARGS[*]}")
26 if [ -n "$FOLDER" ]; then
27 RBW_ARGS+=("--folder" "$FOLDER")
28 fi
29 rbw get --clipboard "${RBW_ARGS[@]}" "$NAME"
30}
31
32rbwsearch $@

tools/tools.csv

Deleted
deleted file mode 100644

+0 / −60 text lines

1name;bin;cargo_args
2asm-cli-rust; asm-cli-rust; --git https://github.com/cch123/asm-cli-rust
3bat
4bk
5bottom; btm
6cargo-cache
7cargo-update;cargo-install-update
8carl
9calendar-rs;calendar
10du-dust; dust
11dotenv-linter
12diskonaut
13eva
14emplace
15eza; eza; --features vendored-openssl,vendored-libgit2
16fend
17fd-find;fd
18git-delta;delta
19gitu;gitu; --locked
20gitoxide;gix
21hexyl
22hyperfine
23inlyne
24jj-cli; jj; --locked --bin jj
25just
26lms
27lurk-cli; lurk
28lychee;lychee; --locked --no-default-features --features rustls-tls,email-check
29macchina
30mdbook
31mdcat
32monolith
33names
34netscanner
35neovide;neovide; --git https://github.com/neovide/neovide
36nu;nu; --locked
37nu_plugin_audio_hook; nu_plugin_audio_hook; --git https://github.com/FMotalleb/nu_plugin_audio_hook.git --features all-decoders
38ouch
39pastel
40presenterm
41pueue;pueue;--locked
42ripgrep;rg
43rbw
44skim;sk
45sbyte
46sniffnet
47taplo-cli;taplo; --locked --features lsp
48tealdeer;tldr
49tokei
50topgrade
51tsdl
52ttyper
53unison-fsmonitor
54ugdb
55vivid
56wthrr
57yazi-cli;ya; --locked
58yazi-fm;yazi; --locked
59zoxide

tools/wezterm_terminfo.sh

Modified

+4 / −4 text lines

1tempfile=$(mktemp) \
2 && curl -o "$tempfile" https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \
3 && tic -x -o ~/.terminfo "$tempfile" \
4 && rm "$tempfile"
1tempfile=$(mktemp) \
2 && curl -o "$tempfile" https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \
3 && tic -x -o ~/.terminfo "$tempfile" \
4 && rm "$tempfile"