Commit Graph

50 Commits

Author SHA1 Message Date
Casey Rodarmor
70768eb24c
Release v0.8.2 (#715)
- Bump version: 0.8.1 → 0.8.2
- Update dependencies
- Update changelog
- Update man page
- Update config test
2020-10-26 18:30:23 -07:00
Casey Rodarmor
b64718b295
Release v0.8.1 (#707)
- Bump version: 0.8.0 → 0.8.1
- Update dependencies
- Update changelog
- Update man page
- Update config test
2020-10-15 20:17:38 -07:00
Casey Rodarmor
d1efc18174
Allow choosing multiple recipes to run (#700)
Modifies the `--choose` subcommand to allow a chooser to return
space-separated recipe names recipes to run.
2020-10-10 17:54:58 -07:00
Casey Rodarmor
935f1130ac
Release v0.8.0 (#691)
- Bump version: 0.7.3 → 0.8.0
- Update dependencies
- Update changelog
- Update man page
- Update config test
2020-10-03 14:32:53 -07:00
Matt Boulanger
991f42d4ac
Move separate quiet config value to verbosity (#686)
Moves the separate quiet variable in the `Config` struct into the existing
verbosity field; the `Verbosity` enum now has a `Quiet` variant. When running, the
presence of the quiet flag will set the verbosity to `Quiet`, overriding any
number of verbosity flags in the CLI args.
2020-10-01 20:00:15 -07:00
Casey Rodarmor
d3ec3e4ce8
Release v0.7.3 (#681)
- Bump version: 0.7.2 → 0.7.3
- Update changelog
- Update man page
- Update config test
2020-09-17 19:51:46 -07:00
Casey Rodarmor
9d0246998d
Add the --choose subcommand (#680)
The `--choose` subcommand runs a chooser to select a recipe to run. The
chooser should read lines containing recipe names from standard input,
and write one of those names to standard output.

The chooser defaults to `fzf`, a popular fuzzy finder, but can be
overridden by setting $JUST_CHOOSER or passing `--chooser <CHOOSER>`.
2020-09-17 19:43:04 -07:00
Casey Rodarmor
551a22b5fc
Release v0.7.2 (#670)
- Bump version: 0.7.1 → 0.7.2
- Update dependencies
- Update changelog
- Update man page
- Update config test
2020-08-23 20:21:08 -07:00
Casey Rodarmor
9ecfd2bef4
Add option to print recipes in source order (#669)
Add an `--unsorted` flag, which makes `--list` and `--summary` print
their entries in source order.
2020-08-21 15:13:54 -07:00
Casey Rodarmor
981465ad30
Release v0.7.1 (#662)
- Bump version: 0.7.0 → 0.7.1
- Update changelog
- Update man page
- Update config test
2020-07-19 05:10:38 -07:00
Casey Rodarmor
c1a0001939
Release v0.7.0 (#657)
- Bump version: 0.6.1 → 0.7.0
- Update dependencies
- Update changelog
- Update man page
- Update config test
2020-07-16 21:58:49 -07:00
Casey Rodarmor
7384307fdc
Release v0.6.1 (#653)
- Bump version: 0.6.0 → 0.6.1
- Update dependencies
- Update changelog
- Update man page
- Update config test
2020-06-28 15:07:03 -07:00
Casey Rodarmor
863fb53885
Release v0.6.0 (#649)
- Bump version: 0.5.11 -> 0.6.0
- Update dependencies
- Update changelog
- Update man page
- Update config test
2020-06-18 11:50:47 -07:00
Casey Rodarmor
2e6e48d8f4
Release v0.5.11 (#629)
- Bump version: `0.5.10` -> `0.5.11`
- Update changelog
- Update dependencies
- Update man page
- Update config test
- Publish to cargo last in release recipe
2020-05-23 20:59:11 -07:00
Casey Rodarmor
d6a1a2b568
Don't load .env file when --no-dotenv is passed (#627)
Add a `--no-dotenv` flag that suppresses loading `.env` files.
2020-05-23 20:41:12 -07:00
Matt Boulanger
dc7210bca3
Suggest aliases for unknown recipes (#624) 2020-04-26 14:19:21 -07:00
Casey Rodarmor
985a6a833d
Release v0.5.10 (#613)
- Bump version: `0.5.9` -> `0.5.10`
- Update changelog
- Update dependencies
- Update man page
- Update config test
- Fix publish and check recipes
2020-03-18 09:03:21 -07:00
Casey Rodarmor
8fea09a3dd
Release v0.5.9 (#612)
- Bump version number: `0.5.8` -> `0.5.9`
- Update changelog
- Update dependencies
- Update config test
- Add `pr` and `push` to justfile
2020-03-18 08:19:43 -07:00
Zhenhui Xie
e79482f2dc
Update zsh completion file (#606)
- Complete variable names after `--set`
- Complete recipe names
- Display recipe signature and body below command line
- Modify completions subcommand to produce enhanced zsh completion script
2020-03-16 17:20:14 -07:00
Casey Rodarmor
784232e98b
Trim completions and ensure final newline (#609)
Trim whitespace at beginning and end of generated completions.
Additionally, since some editors will automatically insert a final
newline into text files, make sure a final newline is present.
2020-03-14 21:41:57 -07:00
Casey Rodarmor
1dbc765390
Add --variables subcommand that prints variable names (#608)
Add a subcommand that prints out a space-separated list of the names of
top-level variables in the justfile.

The syntax is:

    $ just --variables
    a b c

This can be used for any purpose, but is mostly intended for completion
scripts, so that they can get the names of variables without using
`--evaluate`.

Additionally:

- Add `bin/generate-completions` script to regenerate checked-in
  completions
- Update dependencies
- Regenerate checked-in completions
2020-03-13 22:19:43 -07:00
Casey Rodarmor
dcc98abdf8
Don't require justfile to print completions (#596)
Currently, the `--completions` subcommand will fail if there is no
justfile present. A justfile isn't needed to print completions, so fix
this.
2020-02-20 06:07:25 -08:00
Casey Rodarmor
9731278d2a
Wrap comments at 80 characters (#593)
I think 70 is too agressive, especially since it includes indentation
when determining line length.
2020-02-14 04:49:25 -08:00
Casey Rodarmor
3ec7dea4a3
Use unstable rustfmt configuration options (#592) 2020-02-10 20:07:06 -08:00
Casey Rodarmor
aceee3e217
Release v0.5.7 (#591)
- Bump version: v0.5.7 -> v0.5.8
- Update changelog
- Update man page
- Update config test
- Update dependencies
2020-02-06 12:25:09 -08:00
Casey Rodarmor
1d084f1d4e
Release v0.5.7 (#584)
- Bump version: 0.5.6 -> 0.5.7
- Update change log
- Update man page
- Update config test
2020-01-28 03:03:07 -08:00
Casey Rodarmor
f3d5d124a4
Release v0.5.6 (#582)
- Bump version: 0.5.5 -> 0.5.6
- Update change log
- Update man page
- Update config test
2020-01-28 02:31:38 -08:00
Casey Rodarmor
56496e14bf
Release v0.5.5 (#576)
- Bump version: 0.5.4 -> 0.5.5
- Update changelog
- Update man page
- Update config test
2020-01-15 03:33:49 -08:00
Casey Rodarmor
f50196a67f
Check long lines and FIXME/TODO on CI (#575) 2020-01-15 02:30:24 -08:00
Casey Rodarmor
ed991cb509
Add additional continuous integration checks (#574)
Add GitHub Actions checks:

- Clippy is placated
- Rustfmt doesn't produce any changes
- Shell completion scripts are current
2020-01-15 02:16:13 -08:00
Casey Rodarmor
85e8015702
Generate shell completion scripts with --completions (#572)
Make just print clap-generated shell completion scripts with `--completions`
command. Currently, Bash, Zsh, Fish, PowerShell, and Elvish are supported.

Additionally, the generated completion scripts are checked in to the
`completions` folder.
2020-01-15 01:20:38 -08:00
Casey Rodarmor
e14447030a
Release v0.5.4 (#570)
- Bump version: 0.5.3 -> 0.5.4
- Update changelog
- Update man page
- Update config test
2019-12-25 07:46:54 -08:00
Casey Rodarmor
61ab53dbc1
Add justfile_directory() and justfile() (#569)
Add `justfile()` function, returning the current justfile, and
`justfile_directory(), returning its parent directory.
2019-12-25 06:12:06 -08:00
Casey Rodarmor
320e2027a1
Release v0.5.3 (#563)
- Bump version: v0.5.2 -> v0.5.3
- Update changelog
2019-12-11 17:22:46 -08:00
Casey Rodarmor
20790a0cc7
Release v0.5.2 (#557)
- Bump version: v0.5.1 -> v0.5.2
- Update changelog
- Update dependencies
2019-12-07 04:59:58 -08:00
Casey Rodarmor
d0e813cd8b
Add flags to set and clear shell arguments (#551)
Add the `--shell-arg` and `--clear-shell-args` flags, which allow
setting and clearing arguments to the shell from the command line.

This allows full control over the shell from the command line. Additionally,
any shell-related arguments on the command line override
 `set shell := [...]` in the Justfile, which I think will be the behavior that most
people expect.
2019-11-22 13:33:56 -06:00
Casey Rodarmor
4f08bb4d77
Resolve alias targets (#548)
During analysis, resolve alias targets from `Name`s to `Rc<Recipe>`,
giving us type-level assurance that alias resolution was performed, and
avoiding the need to look up alias targets in a separate table when
running.
2019-11-21 09:39:32 -06:00
Casey Rodarmor
e5232fda89
Release v0.5.1 (#544)
- Bump version: v0.5.0 -> v0.5.1
- Update changelog
2019-11-20 02:08:58 -06:00
Casey Rodarmor
e948f11784
Add --init subcommand (#541)
When `--init` is passed on the command line, search upward for the
project root, identified by the presence of a VCS directory like `.git`,
falling back to the current directory, and create a default justfile in
that directory.
2019-11-20 01:07:44 -06:00
Casey Rodarmor
c40d16f2a2
Release: v0.5.0 (#530)
- Bump version: v0.4.5 -> v0.5.0
- Update dependencies
- Update changelog
- Appease linter
- Appease clippy
2019-11-12 14:11:53 -08:00
Casey Rodarmor
177516bcbe
Reform positional argument parsing (#523)
This diff makes positional argument parsing much cleaner, along with
adding a bunch of tests. Just's positional argument parsing is rather,
complex, so hopefully this reform allows it to both be correct and stay
correct.

User-visible changes:

- `just ..` is now accepted, with the same effect as `just ../`

- `just .` is also accepted, with the same effect as `just`

- It is now an error to pass arguments or overrides to subcommands
  that do not accept them, namely `--dump`, `--edit`, `--list`,
  `--show`, and `--summary`. It is also an error to pass arguments to
  `--evaluate`, although `--evaluate` does of course still accept
  overrides.

  (This is a breaking change, but hopefully worth it, as it will allow us
  to add arguments to subcommands which did not previously take
  them, if we so desire.)

- Subcommands which do not accept arguments may now accept a
  single search-directory argument, so `just --list ../` and
  `just --dump foo/` are now accepted, with the former starting the
  search for the justfile to list in the parent directory, and the latter
  starting the search for the justfile to dump in `foo`.
2019-11-10 18:02:36 -08:00
Casey Rodarmor
aefdcea7d0
Gargantuan refactor (#522)
- Instead of changing the current directory with `env::set_current_dir`
  to be implicitly inherited by subprocesses, we now use
  `Command::current_dir` to set it explicitly. This feels much better,
  since we aren't dependent on the implicit state of the process's
  current directory.

- Subcommand execution is much improved.

- Added a ton of tests for config parsing, config execution, working
  dir, and search dir.

- Error messages are improved. Many more will be colored.

- The Config is now onwed, instead of borrowing from the arguments and
  the `clap::ArgMatches` object. This is a huge ergonomic improvement,
  especially in tests, and I don't think anyone will notice.

- `--edit` now uses `$VISUAL`, `$EDITOR`, or `vim`, in that order,
  matching git, which I think is what most people will expect.

- Added a cute `tmptree!{}` macro, for creating temporary directories
  populated with directories and files for tests.

- Admitted that grammer is LL(k) and I don't know what `k` is.
2019-11-09 21:43:20 -08:00
Casey Rodarmor
8279361b39
Move subcommand execution into Subcommand (#514)
Moves the code which executes subcommands into Subcommand:run,
delegating to separate functions for each subcommand. This reduces the
disgustingness of `run::run` a bit, and paves the way for future
refactoring and cleanup.
2019-11-07 13:52:22 -08:00
Casey Rodarmor
33ba66dbb6
Move cd out of Config::from_matches (#513)
Move `env::set_current_dir` outside of `Config::from_matches()` and into
`run()`. It's a bit cleaner this way, and sets us up to make the just
process not change its own directory at all, instead explicitly changing
the working directory of its child processes.
2019-11-07 13:29:17 -08:00
Casey Rodarmor
2ff33de5a1
Highlight echoed recipe lines in bold by default (#512)
Make `--highlight`, which highlights echoed recipe lines in bold, the
default behavior. Add `--no-highlight` to activate the old behavior.
2019-11-07 11:50:11 -08:00
Casey Rodarmor
f3b8030070
Bump version: v0.4.4 -> v0.4.5 (#505) 2019-10-31 19:19:01 -07:00
Casey Rodarmor
48b25c14b1
Use constants instead of literals in arg parser (#504)
- Differentiate between `arg`s, which are flags and options, and `cmd`s,
  which are mutually exclusive subcommands

- Replace string literals, like "EVALUATE", with constants, like
  `cmd::EVALUATE`, since they're slightly less error prone.

- Remove `Config::evaluate`, and handle it like other subcommands
2019-10-31 17:39:25 -07:00
Casey Rodarmor
ca4f2a44ed
Refactor run::run and Config (#490)
Improve color parsing, add `ConfigError`, put `invocation_directory` on Config object, return error code from `run::run` instead of exiting.
2019-10-09 00:18:53 -07:00
Casey Rodarmor
ab11740104
Add explicit Subcommand enum (#484) 2019-10-07 04:04:39 -07:00
Casey Rodarmor
2938ab1561
Start pulling argument parsing out of run::run() (#483)
run::run() is pretty unwieldy. As a first step in improving it, this
commit pulls most of the argument parsing into the `config` module.

It also renames `Configuration` to `Config`, just to be easier to type.
2019-10-07 02:06:45 -07:00