Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make command line GNU-compatible #2429

Merged
merged 88 commits into from Jul 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
cf8293d
Initial draft of paket completion
agross Oct 19, 2016
08d5b78
Top-level commands
agross Jun 13, 2017
ea8fda3
It does not make sense to invoke `paket add --version`
agross Jun 13, 2017
a76920f
Default argument order
agross Jun 14, 2017
b76b10f
add
agross Jun 13, 2017
fa7b6c7
why
agross Jun 14, 2017
8492219
Stay backward compatible with add and why:
agross Jun 14, 2017
fba4d1c
Docs: review
agross Jun 14, 2017
6984574
Improve formatting of command parameters (make it just like the conso…
agross Jun 14, 2017
604da60
Be more verbose about the --verbose parameter
agross Jun 14, 2017
982d75b
Docs: correct spelling of my last name
agross Jun 14, 2017
7bf862f
Docs: reviewed all command docs
agross Jun 14, 2017
ce753f7
Docs: review testimonials
agross Jun 14, 2017
109baf1
Docs: review Git(Hub) dependencies
agross Jun 14, 2017
e79ddfd
find-packages
agross Jun 15, 2017
0dd7064
config
agross Jun 18, 2017
57fcc8f
convert-from-nuget
agross Jun 18, 2017
a66641d
find-package-versions
agross Jun 18, 2017
99ddd09
Improve code style by wrapping and scoping
agross Jun 18, 2017
5e8a66d
Preparations for zsh completion
agross Jun 23, 2017
15b6b44
Add unimplemented, but updateable completion for bash
agross Jun 24, 2017
af97256
Formatting
agross Jun 25, 2017
2fe0e15
find-refs
agross Jun 25, 2017
9da8c8e
generate-load-scripts
agross Jun 25, 2017
3d7dfe4
working on paket why
agross Jun 14, 2017
d94b9c9
NuGet package ID completion
agross Jun 15, 2017
972cf96
config
agross Jun 15, 2017
a01633f
improve group option
agross Jun 15, 2017
32f2763
improve utility functions running external programs
agross Jun 15, 2017
9df9c72
config and sources
agross Jun 15, 2017
a59fa23
convert-from-nuget
agross Jun 18, 2017
8a58d46
auto-restore
agross Jun 18, 2017
4edd9c8
clear-cache
agross Jun 18, 2017
4e960d6
Support sources read from paket.dependencies and a few static ones, a…
agross Jun 18, 2017
8262604
Add/document configuration options
agross Jun 18, 2017
f32f2c9
Document setup
agross Jun 19, 2017
b8bcf51
Complete version constraint based on package id
agross Jun 22, 2017
81b0fce
Support constraints and complete fake versions if there is one
agross Jun 22, 2017
b932af5
Allow turning off completions that require too much time
agross Jun 22, 2017
59ddcd3
Add caching and more config options
agross Jun 22, 2017
72e8cd9
Improve settings handler
agross Jun 22, 2017
eb4d610
Use local context instead of passing args
agross Jun 22, 2017
e2f9911
Improve version constraint and number completion
agross Jun 22, 2017
9fdf7bd
Negate prefix-match to infix-match
agross Jun 22, 2017
93d3de9
Docs
agross Jun 23, 2017
75e75db
Extended download docs, update docs added self-updater
agross Jun 23, 2017
5a78896
Infix docs
agross Jun 23, 2017
3956d1e
Change OS check to wildcard match
agross Jun 23, 2017
d77d978
Support strategy modifiers
agross Jun 23, 2017
62b677c
Docs
agross Jun 23, 2017
4bfeb20
Remove trailing slash from default download URL
agross Jun 24, 2017
daca5da
More setup docs
agross Jun 24, 2017
a8fc155
Align variable definitions per zsh docs
agross Jun 25, 2017
fb08c74
compadd with double dashes as documented
agross Jun 25, 2017
61e276f
List packages either in Main group or as per --group parameter
agross Jun 25, 2017
e5d1082
Cache output of show-groups and show-installed-packages
agross Jun 25, 2017
59d6708
generate-load-scripts
agross Jun 25, 2017
0cf4c75
init
agross Jun 25, 2017
4a6b0e4
show-groups
agross Jun 25, 2017
185fb8c
simplify
agross Jun 25, 2017
16fe271
Fix subcommand group casing
agross Jun 26, 2017
3fa53b5
Remove unneeded commands from completion
agross Jun 26, 2017
89700cd
paket-completion-update: resolve symlink target
agross Jun 26, 2017
6c60889
Map output using zsh parameter expansion
agross Jun 26, 2017
75f2ab9
Output warnings to stderr
agross Jun 26, 2017
65a9dd2
Hide obsolete subcommands
agross Jun 26, 2017
2863411
install
agross Jun 26, 2017
09c3685
outdated
agross Jun 26, 2017
859166d
show-installed-packages
agross Jun 26, 2017
15ff048
Option argument name review
agross Jun 26, 2017
24899c8
update
agross Jun 26, 2017
bf5e175
Reuse completion markdown files for GitHub Pages docs
agross Jun 26, 2017
c36ec23
Improved docs describing the updater
agross Jun 26, 2017
79f9f9b
Review option descriptions
agross Jun 27, 2017
5009d3d
pack
agross Jun 27, 2017
1900c65
Allow script language to be specified more than once
agross Jun 27, 2017
f644fdc
Define argument arity
agross Jun 27, 2017
c6cf326
Some arguments had special arity
agross Jun 27, 2017
d7713e2
push
agross Jun 27, 2017
ac78231
remove
agross Jun 27, 2017
9323737
restore
agross Jun 27, 2017
2beeec4
Fix one test that verified that generate-load-scripts parses the scri…
agross Jun 27, 2017
32916ee
Review docs
agross Jun 28, 2017
90c0ac0
Refactor requiring args with backward compatibility into function
agross Jun 27, 2017
cd16ae2
Fix links to PRs in release notes
agross Jun 28, 2017
ccf2329
Add favicon
agross Jun 28, 2017
1e94c15
Add simplistic bash completion
agross Jun 29, 2017
83a33be
Support overriding the locations of local paket.exes, support global …
agross Jul 4, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -199,3 +199,7 @@ tests/Paket.Tests/NuGetConfig/PasswordConfig.xml
paket.local
dotnetcore
.idea

# For check-doc-links.sh.
node_modules
package-lock.json
9 changes: 8 additions & 1 deletion Paket.sln
Expand Up @@ -37,6 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{8E6D
docs\content\analyzers.md = docs\content\analyzers.md
docs\content\bootstrapper.md = docs\content\bootstrapper.md
docs\content\caches.md = docs\content\caches.md
docs\content\controlling-nuget-resolution.md = docs\content\controlling-nuget-resolution.md
docs\content\convert-from-nuget-tutorial.md = docs\content\convert-from-nuget-tutorial.md
docs\content\dependencies-file.md = docs\content\dependencies-file.md
docs\content\editor-support.md = docs\content\editor-support.md
Expand All @@ -49,13 +50,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{8E6D
docs\content\http-dependencies.md = docs\content\http-dependencies.md
docs\content\index.md = docs\content\index.md
docs\content\installation.md = docs\content\installation.md
docs\content\license.md = docs\content\license.md
docs\content\local-file.md = docs\content\local-file.md
docs\content\lock-file.md = docs\content\lock-file.md
docs\content\nuget-dependencies.md = docs\content\nuget-dependencies.md
docs\content\paket-folder.md = docs\content\paket-folder.md
docs\content\paket.dependencies = docs\content\paket.dependencies
docs\content\paket.lock = docs\content\paket.lock
docs\content\reference-from-repl.fsx = docs\content\reference-from-repl.fsx
docs\content\references-files.md = docs\content\references-files.md
docs\content\release-notes.md = docs\content\release-notes.md
docs\content\resolver.fsx = docs\content\resolver.fsx
docs\content\template-files.md = docs\content\template-files.md
docs\content\testimonials.md = docs\content\testimonials.md
Expand All @@ -75,19 +79,22 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "commands", "commands", "{44
ProjectSection(SolutionItems) = preProject
docs\content\commands\add.md = docs\content\commands\add.md
docs\content\commands\auto-restore.md = docs\content\commands\auto-restore.md
docs\content\commands\clear-cache.md = docs\content\commands\clear-cache.md
docs\content\commands\config.md = docs\content\commands\config.md
docs\content\commands\convert-from-nuget.md = docs\content\commands\convert-from-nuget.md
docs\content\commands\find-package-versions.md = docs\content\commands\find-package-versions.md
docs\content\commands\find-packages.md = docs\content\commands\find-packages.md
docs\content\commands\find-refs.md = docs\content\commands\find-refs.md
docs\content\commands\generate-include-scripts.md = docs\content\commands\generate-include-scripts.md
docs\content\commands\generate-load-scripts.md = docs\content\commands\generate-load-scripts.md
docs\content\commands\install.md = docs\content\commands\install.md
docs\content\commands\outdated.md = docs\content\commands\outdated.md
docs\content\commands\pack.md = docs\content\commands\pack.md
docs\content\commands\remove.md = docs\content\commands\remove.md
docs\content\commands\restore.md = docs\content\commands\restore.md
docs\content\commands\show-installed-packages.md = docs\content\commands\show-installed-packages.md
docs\content\commands\simplify.md = docs\content\commands\simplify.md
docs\content\commands\update.md = docs\content\commands\update.md
docs\content\commands\why.md = docs\content\commands\why.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Paket.Bootstrapper.Tests", "tests\Paket.Bootstrapper.Tests\Paket.Bootstrapper.Tests.csproj", "{7C622582-E281-4EAB-AADA-B5893BB89B45}"
Expand Down
72 changes: 36 additions & 36 deletions RELEASE_NOTES.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions check-doc-links.sh
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e

./build.sh GenerateDocs

npm install http-server broken-link-checker
node_modules/.bin/http-server docs/output --silent &
printf 'Started web server PID %s\n' $!

# Ignore errors to be able to kill the web server.
node_modules/.bin/blc --get --recursive --filter-level 3 http://localhost:8080 || true

[[ -n "$!" ]] && kill -9 $!
3 changes: 3 additions & 0 deletions completion/.gitattributes
@@ -0,0 +1,3 @@
* text=auto
*.bash text=auto eol=lf
*.zsh text=auto eol=lf
74 changes: 74 additions & 0 deletions completion/README.bash.md
@@ -0,0 +1,74 @@
# Paket shell completion for [bash](https://www.gnu.org/software/bash/)

## Installation

### Download

#### Option 1: Save the completion script to your home directory

1. Download the
[`paket-completion.bash` file](https://raw.githubusercontent.com/fsprojects/Paket/master/completion/paket-completion.bash)
to a subdirectory of your home directory, preferably a directory with other
function files.
1. `source` the file in your `~/.bashrc`.

```sh
$ target="$HOME/.bash-completions/paket-completion.bash"
$ mkdir "$(dirname "$target")"
$ curl --fail --location --proto-redir -all,https --output "$target" \
https://raw.githubusercontent.com/fsprojects/Paket/master/completion/paket-completion.bash
```

In your `~/.bashrc`:

```sh
source "$HOME/.bash-completions/paket-completion.bash"
```

#### Option 2: Save the completion script to `/etc/bash_completion.d/`

1. Download the `paket-completion.bash` file to `/etc/bash_completion.d/`.
1. Restart your shell.

```sh
$ target="/etc/bash_completion.d/paket-completion.bash"
$ curl --fail --location --proto-redir -all,https --output "$target" \
https://raw.githubusercontent.com/fsprojects/Paket/master/completion/paket-completion.bash
```

### Updating an existing installation

Just repeat the download from above.

Alternatively the completion script comes bundled with the
`paket-completion-update` function that will download the current
`paket-completion.bash` to the same file as above, even if you changed its
location after the initial download.

**Please note:** The `paket-completion-update` function requires the completion
script to be `source`d and `curl` to be installed.

`paket-completion-update` supports an optional first parameter that allows you
to override the default download root URL which is
`https://raw.githubusercontent.com/fsprojects/Paket/master/completion`.

### `paket` alias

For easier consumption of Paket (without `paket.sh` or `paket.cmd`) it is
advised to create an alias and always run Paket from the repository root.

Also have a look at
[Paket's magic mode](https://fsprojects.github.io/Paket/bootstrapper.html#Magic-mode).

Somewhere in your `~/.bashrc`:

```sh
if [[ "$OS" != Windows* ]]; then
alias paket='mono ./.paket/paket.exe'
else
alias paket='./.paket/paket.exe'
fi

# Complete the paket alias using the _paket function.
complete -F _paket paket
```
7 changes: 7 additions & 0 deletions completion/README.md
@@ -0,0 +1,7 @@
# Paket shell completion

Currently we provide completion for the following shells:

* [bash](README.bash.md) *-- currently only implements Paket subcommand
completion (e.g. `add`, `auto-restore`, ...)*
* [zsh](README.zsh.md)