From e8342c1d97ced0e2d05ef7dc2c06b69c3ce74020 Mon Sep 17 00:00:00 2001 From: buhl <221842+buhl@users.noreply.github.com> Date: Mon, 8 Feb 2021 16:05:40 +0100 Subject: [PATCH 1/2] Squashed 'vendor/github.com/vigo/apm-bash-completion/' content from commit d44593c git-subtree-dir: vendor/github.com/vigo/apm-bash-completion git-subtree-split: d44593c3f0514e1fcc668e47f875f83ceb054b36 --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++ README.md | 70 ++++++++++++++++++++++++++++++++++++++++++ apm | 63 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 230 insertions(+) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 apm diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..db8700e44b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ugurozyilmazel@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..828710048a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Uğur "vigo" Özyılmazel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000..52b43a37bb --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# Bash Completion for Atom Package Manager (apm) + +If you use [Atom](http://atom.io) editor, you'll like this completion helper. + +## Installation + +You can install via [Homebrew](http://brew.sh) + + brew install homebrew/completions/apm-bash-completion + +## Usage + +```bash +$ apm [TAB] + +clean featured ln remove unlink +config help lns rm unpublish +dedupe home login search unstar +deinstall init ls show update +delete install open star upgrade +dev link outdated starred view +develop linked publish stars +docs links rebuild test +erase list rebuild-module-cache uninstall + +$ apm publish +build major minor patch + +$ apm config +delete edit get list set +``` + +## Manual Usage + +Just get the file `apm` and call `source apm` (or add it to your bash environment) + +--- + +## What’s New? + +Well, I even don’t remember this project since I’ve got mail today about +missing LICENSE file. Feel free to contribute, add missing pieces :) + +--- + +## Contribution + +Please let me know if you need some more options. Please create an issue and +make a request. Also If you like to improve or add more features please fork +it and you know the rest :) + +1. Fork it ( https://github.com/vigo/apm-bash-completion ) +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create a new Pull Request + +--- + +## Contributer(s) + +* [Uğur "vigo" Özyılmazel](https://github.com/vigo) - Creator, maintainer + +--- + +## License + +This project is licensed under MIT + +--- diff --git a/apm b/apm new file mode 100644 index 0000000000..0804801f3e --- /dev/null +++ b/apm @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# this is the modified version of bundle bash-completion. +# Copyright (c) 2011-2013 Daniel Luz (bundle bash-completion) +# +# apm bash-completion is written by Ugur Ozyilmazel +# github: @vigo, twitter: @vigobronx +# enjoy! +# +# you need to activate this via +# $ source apm + +__apm(){ + local cur prev options apm_command + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + __apm_get_command + if [[ $cur = -* ]]; then + options="--color" + if [[ -z $apm_command ]]; then + options="$options --version --help" + fi + if [[ $apm_command && $apm_command = publish ]]; then + options="--tag --rename" + fi + else + if [[ -z $apm_command || $apm_command = help ]]; then + options="help clean config dedupe deinstall delete dev develop docs erase featured home init install link linked links list ln lns login ls open outdated publish rebuild rebuild-module-cache remove rm search show star starred stars test uninstall unlink unpublish unstar update upgrade view" + fi + if [[ $apm_command && $apm_command = publish ]]; then + options="major minor patch build" + fi + if [[ $apm_command && $apm_command = config ]]; then + options="set get delete list edit" + fi + fi + COMPREPLY=($(compgen -W "$options" -- "$cur")) +} +__apm_get_command() { + local i + for ((i=1; i < $COMP_CWORD; ++i)); do + local arg=${COMP_WORDS[$i]} + case $arg in + [^-]*) + apm_command=$arg + return;; + --version) + apm_command=- + return;; + --help) + apm_command=help + return;; + publish) + apm_command=publish + return;; + config) + apm_command=config + return;; + esac + done +} +complete -F __apm -o bashdefault -o default apm From 7fb7e279218c265a4e8a64d7ee135fb81f00923d Mon Sep 17 00:00:00 2001 From: buhl <221842+buhl@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:17:53 +0100 Subject: [PATCH 2/2] Added vendored apm completion --- clean_files.txt | 1 + completion/available/apm.completion.bash | 81 ++---------------------- 2 files changed, 5 insertions(+), 77 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index 3976ce4b56..73f4762017 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -60,6 +60,7 @@ plugins/available/xterm.plugin.bash # completions # +completion/available/apm.completion.bash completion/available/awless.completion.bash completion/available/brew.completion.bash completion/available/cargo.completion.bash diff --git a/completion/available/apm.completion.bash b/completion/available/apm.completion.bash index c994074356..c3dcfe45f8 100644 --- a/completion/available/apm.completion.bash +++ b/completion/available/apm.completion.bash @@ -1,77 +1,4 @@ -#!/usr/bin/env bash - -# The MIT License (MIT) - -# Copyright (c) 2015 Uğur "vigo" Özyılmazel - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# repo: https://github.com/vigo/apm-bash-completion - -__apm(){ - local cur prev options apm_command - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - __apm_get_command - if [[ $cur = -* ]]; then - options="--color" - if [[ -z $apm_command ]]; then - options="$options --version --help" - fi - if [[ $apm_command && $apm_command = publish ]]; then - options="--tag --rename" - fi - else - if [[ -z $apm_command || $apm_command = help ]]; then - options="help clean config dedupe deinstall delete dev develop docs erase featured home init install link linked links list ln lns login ls open outdated publish rebuild rebuild-module-cache remove rm search show star starred stars test uninstall unlink unpublish unstar update upgrade view" - fi - if [[ $apm_command && $apm_command = publish ]]; then - options="major minor patch build" - fi - if [[ $apm_command && $apm_command = config ]]; then - options="set get delete list edit" - fi - fi - COMPREPLY=($(compgen -W "$options" -- "$cur")) -} -__apm_get_command() { - local i - for ((i=1; i < $COMP_CWORD; ++i)); do - local arg=${COMP_WORDS[$i]} - case $arg in - [^-]*) - apm_command=$arg - return;; - --version) - apm_command=- - return;; - --help) - apm_command=help - return;; - publish) - apm_command=publish - return;; - config) - apm_command=config - return;; - esac - done -} -complete -F __apm -o bashdefault -o default apm +# shellcheck shell=bash +about-completion "apm completion" +# shellcheck disable=SC1090 +source "${BASH_IT}"/vendor/github.com/vigo/apm-bash-completion/apm