Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit 9724040

Browse files
committed
rename opts to getopt, add comments
1 parent b494bfb commit 9724040

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

lib/opts.ps1 renamed to lib/getopt.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# adapted from http://hg.python.org/cpython/file/2.7/Lib/getopt.py
2+
# argv:
3+
# array of arguments
4+
# shortopts:
5+
# string of single-letter options. options that take a parameter
6+
# should be follow by ':'
7+
# longopts:
8+
# array of strings that are long-form options. options that take
9+
# a parameter should end with '='
210
# returns @(opts hash, rem_args array, error string)
311
function getopt($argv, $shortopts, $longopts) {
412
$opts = @{}; $rem = @()

libexec/scoop-install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
. "$psscriptroot\..\lib\install.ps1"
2323
. "$psscriptroot\..\lib\versions.ps1"
2424
. "$psscriptroot\..\lib\help.ps1"
25-
. "$psscriptroot\..\lib\opts.ps1"
25+
. "$psscriptroot\..\lib\getopt.ps1"
2626

2727
function install($app, $architecture, $global) {
2828
$app, $manifest, $bucket, $url = locate $app

libexec/scoop-uninstall.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
. "$psscriptroot\..\lib\help.ps1"
1010
. "$psscriptroot\..\lib\install.ps1"
1111
. "$psscriptroot\..\lib\versions.ps1"
12-
. "$psscriptroot\..\lib\opts.ps1"
12+
. "$psscriptroot\..\lib\getopt.ps1"
1313

1414
# options
1515
$opt, $app, $err = getopt $args 'g' 'global'

libexec/scoop-update.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
. "$psscriptroot\..\lib\manifest.ps1"
1212
. "$psscriptroot\..\lib\buckets.ps1"
1313
. "$psscriptroot\..\lib\versions.ps1"
14-
. "$psscriptroot\..\lib\opts.ps1"
14+
. "$psscriptroot\..\lib\getopt.ps1"
1515

1616
$opt, $app, $err = getopt $args 'g' 'global'
1717
if($err) { "scoop update: $err"; exit 1 }

test/opts.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
. "$psscriptroot\tests.ps1"
2-
. "$psscriptroot\..\lib\opts.ps1"
2+
. "$psscriptroot\..\lib\getopt.ps1"
33

44
filter_tests $args
55

0 commit comments

Comments
 (0)