-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96fa8e9
commit 724eca9
Showing
14 changed files
with
233 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#compdef arch | ||
|
||
autoload -U is-at-least | ||
|
||
_arch() { | ||
typeset -A opt_args | ||
typeset -a _arguments_options | ||
local ret=1 | ||
|
||
if is-at-least 5.2; then | ||
_arguments_options=(-s -S -C) | ||
else | ||
_arguments_options=(-s -C) | ||
fi | ||
|
||
local context curcontext="$curcontext" state line | ||
_arguments "${_arguments_options[@]}" \ | ||
'-h[Print help]' \ | ||
'--help[Print help]' \ | ||
'-V[Print version]' \ | ||
'--version[Print version]' \ | ||
&& ret=0 | ||
} | ||
|
||
(( $+functions[_arch_commands] )) || | ||
_arch_commands() { | ||
local commands; commands=() | ||
_describe -t commands 'arch commands' commands "$@" | ||
} | ||
|
||
if [ "$funcstack[1]" = "_arch" ]; then | ||
_arch "$@" | ||
else | ||
compdef _arch arch | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
using namespace System.Management.Automation | ||
using namespace System.Management.Automation.Language | ||
|
||
Register-ArgumentCompleter -Native -CommandName 'arch' -ScriptBlock { | ||
param($wordToComplete, $commandAst, $cursorPosition) | ||
|
||
$commandElements = $commandAst.CommandElements | ||
$command = @( | ||
'arch' | ||
for ($i = 1; $i -lt $commandElements.Count; $i++) { | ||
$element = $commandElements[$i] | ||
if ($element -isnot [StringConstantExpressionAst] -or | ||
$element.StringConstantType -ne [StringConstantType]::BareWord -or | ||
$element.Value.StartsWith('-') -or | ||
$element.Value -eq $wordToComplete) { | ||
break | ||
} | ||
$element.Value | ||
}) -join ';' | ||
|
||
$completions = @(switch ($command) { | ||
'arch' { | ||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | ||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | ||
[CompletionResult]::new('-V', 'V ', [CompletionResultType]::ParameterName, 'Print version') | ||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version') | ||
break | ||
} | ||
}) | ||
|
||
$completions.Where{ $_.CompletionText -like "$wordToComplete*" } | | ||
Sort-Object -Property ListItemText | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
_arch() { | ||
local i cur prev opts cmd | ||
COMPREPLY=() | ||
cur="${COMP_WORDS[COMP_CWORD]}" | ||
prev="${COMP_WORDS[COMP_CWORD-1]}" | ||
cmd="" | ||
opts="" | ||
|
||
for i in ${COMP_WORDS[@]} | ||
do | ||
case "${cmd},${i}" in | ||
",$1") | ||
cmd="arch" | ||
;; | ||
*) | ||
;; | ||
esac | ||
done | ||
|
||
case "${cmd}" in | ||
arch) | ||
opts="-h -V --help --version" | ||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then | ||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | ||
return 0 | ||
fi | ||
case "${prev}" in | ||
*) | ||
COMPREPLY=() | ||
;; | ||
esac | ||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | ||
return 0 | ||
;; | ||
esac | ||
} | ||
|
||
complete -F _arch -o nosort -o bashdefault -o default arch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
use builtin; | ||
use str; | ||
|
||
set edit:completion:arg-completer[arch] = {|@words| | ||
fn spaces {|n| | ||
builtin:repeat $n ' ' | str:join '' | ||
} | ||
fn cand {|text desc| | ||
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc | ||
} | ||
var command = 'arch' | ||
for word $words[1..-1] { | ||
if (str:has-prefix $word '-') { | ||
break | ||
} | ||
set command = $command';'$word | ||
} | ||
var completions = [ | ||
&'arch'= { | ||
cand -h 'Print help' | ||
cand --help 'Print help' | ||
cand -V 'Print version' | ||
cand --version 'Print version' | ||
} | ||
] | ||
$completions[$command] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
complete -c arch -s h -l help -d 'Print help' | ||
complete -c arch -s V -l version -d 'Print version' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.ie \n(.g .ds Aq \(aq | ||
.el .ds Aq ' | ||
.TH /home/n4n5/Documents/github/coreutils/target/debug/build/coreutils-5760bf6c2a424d19/build-script-build 1 "/home/n4n5/Documents/github/coreutils/target/debug/build/coreutils-5760bf6c2a424d19/build-script-build 0.0.27" | ||
.SH NAME | ||
/home/n4n5/Documents/github/coreutils/target/debug/build/coreutils\-5760bf6c2a424d19/build\-script\-build \- Display machine architecture | ||
.SH SYNOPSIS | ||
\fB/home/n4n5/Documents/github/coreutils/target/debug/build/coreutils\-5760bf6c2a424d19/build\-script\-build\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] | ||
.SH DESCRIPTION | ||
Display machine architecture | ||
.SH OPTIONS | ||
.TP | ||
\fB\-h\fR, \fB\-\-help\fR | ||
Print help | ||
.TP | ||
\fB\-V\fR, \fB\-\-version\fR | ||
Print version | ||
.SH EXTRA | ||
Determine architecture name for current machine. | ||
.SH VERSION | ||
v0.0.27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod uu_arch { | ||
include!("./uu/arch/src/mod.rs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// This file is part of the uutils coreutils package. | ||
// | ||
// For the full copyright and license information, please view the LICENSE | ||
// file that was distributed with this source code. | ||
|
||
use clap::{crate_version, Command}; | ||
use uucore::{help_about, help_section}; | ||
static ABOUT: &str = help_about!("arch.md"); | ||
static SUMMARY: &str = help_section!("after help", "arch.md"); | ||
|
||
pub fn uu_app() -> Command { | ||
Command::new(uucore::util_name()) | ||
.version(crate_version!()) | ||
.about(ABOUT) | ||
.after_help(SUMMARY) | ||
.infer_long_args(true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters