Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
9539b50d
Commit
9539b50d
authored
Oct 12, 2015
by
Bruno
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #115 from oh-my-fish/omf-list-rewritten
Merge all omf list functions
parents
dc8ec2ec
870efd0d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
85 additions
and
46 deletions
+85
-46
pkg/omf/cli/omf.bundle.install.fish
pkg/omf/cli/omf.bundle.install.fish
+2
-2
pkg/omf/cli/omf.describe.fish
pkg/omf/cli/omf.describe.fish
+2
-1
pkg/omf/cli/omf.list_db_packages.fish
pkg/omf/cli/omf.list_db_packages.fish
+0
-11
pkg/omf/cli/omf.list_installed_packages.fish
pkg/omf/cli/omf.list_installed_packages.fish
+0
-6
pkg/omf/cli/omf.list_installed_themes.fish
pkg/omf/cli/omf.list_installed_themes.fish
+0
-3
pkg/omf/cli/omf.list_local_packages.fish
pkg/omf/cli/omf.list_local_packages.fish
+0
-6
pkg/omf/cli/omf.list_themes.fish
pkg/omf/cli/omf.list_themes.fish
+0
-8
pkg/omf/cli/omf.packages.list.fish
pkg/omf/cli/omf.packages.list.fish
+72
-0
pkg/omf/completions/omf.fish
pkg/omf/completions/omf.fish
+5
-5
pkg/omf/omf.fish
pkg/omf/omf.fish
+4
-4
No files found.
pkg/omf/cli/omf.bundle.install.fish
View file @
9539b50d
...
@@ -2,8 +2,8 @@ function omf.bundle.install
...
@@ -2,8 +2,8 @@ function omf.bundle.install
set bundle $OMF_CONFIG/bundle
set bundle $OMF_CONFIG/bundle
if test -f $bundle
if test -f $bundle
set packages (omf.
list_local_packages
)
set packages (omf.
packages.list --installed --plugin
)
set themes (omf.
list_installed_themes
)
set themes (omf.
packages.list --installed --theme
)
set bundle_contents (cat $bundle | sort -u)
set bundle_contents (cat $bundle | sort -u)
for record in $bundle_contents
for record in $bundle_contents
...
...
pkg/omf/cli/omf.describe.fish
View file @
9539b50d
function omf.describe -a name
function omf.describe -a name
if test (count $argv) -eq 0
if test (count $argv) -eq 0
for package in (omf.
list_db_packages
)
for package in (omf.
packages.list --database
)
echo $package - (omf.describe $package)
echo $package - (omf.describe $package)
end
end
else
else
set package_path $OMF_PATH/db/pkg/$name
set package_path $OMF_PATH/db/pkg/$name
if test -e $package_path
if test -e $package_path
set url (cat $package_path)
set url (cat $package_path)
set repo (basename (dirname $url))/(basename $url)
set repo (basename (dirname $url))/(basename $url)
...
...
pkg/omf/cli/omf.list_db_packages.fish
deleted
100644 → 0
View file @
dc8ec2ec
# List all packages available to install from the registry.
function omf.list_db_packages -a skip_installed
for item in (basename $OMF_PATH/db/pkg/*)
if begin
test -z $skip_installed
or not contains $item (basename {$OMF_PATH,$OMF_CONFIG}/pkg/*)
end
echo $item
end
end
end
pkg/omf/cli/omf.list_installed_packages.fish
deleted
100644 → 0
View file @
dc8ec2ec
# List all packages installed from the registry.
function omf.list_installed_packages
for item in (basename $OMF_PATH/pkg/*)
test $item = omf; or echo $item
end
end
pkg/omf/cli/omf.list_installed_themes.fish
deleted
100644 → 0
View file @
dc8ec2ec
function omf.list_installed_themes
basename $OMF_PATH/themes/*
end
pkg/omf/cli/omf.list_local_packages.fish
deleted
100644 → 0
View file @
dc8ec2ec
# List all custom packages and packages installed from the registry.
function omf.list_local_packages
for item in (basename {$OMF_PATH,$OMF_CONFIG}/pkg/*)
test $item = omf; or echo $item
end
end
pkg/omf/cli/omf.list_themes.fish
deleted
100644 → 0
View file @
dc8ec2ec
function omf.list_themes
set -l seen ""
for theme in (basename $OMF_PATH/db/themes/*) \
(basename {$OMF_PATH,$OMF_CONFIG}/themes/*)
contains $theme $seen; or echo $theme
set seen $seen $theme
end
end
pkg/omf/cli/omf.packages.list.fish
0 → 100644
View file @
9539b50d
function __omf.packages.sort
for package in (echo $argv | tr ' ' '\n' | sort); echo $package; end
end
function __omf.packages.list -a type
set -l list
test "$type" = "--theme"; or for package in (basename {$OMF_CONFIG,$OMF_PATH/db}/pkg/*)
set list $list $package
end
test "$type" = "--plugin"; or for package in (basename {$OMF_CONFIG,$OMF_PATH/db}/themes/*)
set list $list $package
end
__omf.packages.sort $list
end
function __omf.packages.list.available -a type
set -l list
test "$type" = "--theme"; or for package in (basename $OMF_PATH/db/pkg/*)
contains $package (basename {$OMF_CONFIG,$OMF_PATH}/pkg/*); or set list $list $package
end
test "$type" = "--plugin"; or for package in (basename $OMF_PATH/db/themes/*)
contains $package (basename {$OMF_CONFIG,$OMF_PATH}/themes/*); or set list $list $package
end
__omf.packages.sort $list
end
function __omf.packages.list.database -a type
set -l list
test "$type" = "--theme"; or for package in (basename $OMF_PATH/db/pkg/*)
set list $list $package
end
test "$type" = "--plugin"; or for package in (basename $OMF_PATH/db/themes/*)
set list $list $package
end
__omf.packages.sort $list
end
function __omf.packages.list.installed -a type
set -l list
test "$type" = "--theme"; or for package in (basename {$OMF_CONFIG,$OMF_PATH}/pkg/*)
set list $list $package
end
test "$type" = "--plugin"; or for package in (basename {$OMF_CONFIG,$OMF_PATH}/themes/*)
set list $list $package
end
__omf.packages.sort $list
end
function omf.packages.list -a option type
switch "$option"
case "--available"
__omf.packages.list.available $type
case "--database"
__omf.packages.list.database $type
case "--installed"
__omf.packages.list.installed $type
case "*"
__omf.packages.list $type
end
end
pkg/omf/completions/omf.fish
View file @
9539b50d
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
complete -c omf -f -d "Oh My Fish"
complete -c omf -f -d "Oh My Fish"
complete -c omf -f -n "__fish_seen_subcommand_from r rm remove" -a (printf "%s " (omf.
list_local_packages) (omf.list_installed_themes
))
complete -c omf -f -n "__fish_seen_subcommand_from r rm remove" -a (printf "%s " (omf.
packages.list --installed
))
complete -c omf -f -n "__fish_seen_subcommand_from d desc describe" -a (printf "%s " (omf.
list_db_packages
))
complete -c omf -f -n "__fish_seen_subcommand_from d desc describe" -a (printf "%s " (omf.
packages.list --database --plugin
))
complete -c omf -f -n "__fish_seen_subcommand_from c cd" -a (printf "%s " (omf.
list_db_packages
))
complete -c omf -f -n "__fish_seen_subcommand_from c cd" -a (printf "%s " (omf.
packages.list --installed
))
complete -c omf -f -n "__fish_seen_subcommand_from i install" -a (printf "%s " (omf.
list_db_packages "skip installed packages"
))
complete -c omf -f -n "__fish_seen_subcommand_from i install" -a (printf "%s " (omf.
packages.list --available --plugin
))
complete -c omf -f -n "__fish_seen_subcommand_from t theme" -a (printf "%s " (omf.
list_themes
))
complete -c omf -f -n "__fish_seen_subcommand_from t theme" -a (printf "%s " (omf.
packages.list --database --theme
))
complete -c omf -f -n "__fish_seen_subcommand_from help" -a "install theme remove update list describe cd new submit destroy doctor"
complete -c omf -f -n "__fish_seen_subcommand_from help" -a "install theme remove update list describe cd new submit destroy doctor"
complete -c omf -f -a list -n "__fish_use_subcommand" -d "List local packages"
complete -c omf -f -a list -n "__fish_use_subcommand" -d "List local packages"
...
...
pkg/omf/omf.fish
View file @
9539b50d
...
@@ -83,7 +83,7 @@ function omf -d "Oh My Fish"
...
@@ -83,7 +83,7 @@ function omf -d "Oh My Fish"
end
end
case "l" "ls" "list"
case "l" "ls" "list"
omf.
list_local_packages
| column
omf.
packages.list --installed
| column
case "n" "new"
case "n" "new"
if test (count $argv) -ne 3
if test (count $argv) -ne 3
...
@@ -118,10 +118,10 @@ function omf -d "Oh My Fish"
...
@@ -118,10 +118,10 @@ function omf -d "Oh My Fish"
set -l regex "[[:<:]]($theme)[[:>:]]"
set -l regex "[[:<:]]($theme)[[:>:]]"
test "$ostype" != "Darwin"; and set regex "\b($theme)\b"
test "$ostype" != "Darwin"; and set regex "\b($theme)\b"
omf.
list_themes
| column | sed -E "s/$regex/"(omf::em)"\1"(omf::off)"/"
omf.
packages.list --database --theme
| column | sed -E "s/$regex/"(omf::em)"\1"(omf::off)"/"
omf::off
omf::off
else if test (count $argv) -eq 2
else if test (count $argv) -eq 2
if not contains -- $argv[2] (omf.
list_installed_themes
)
if not contains -- $argv[2] (omf.
packages.list --installed
)
omf.install --theme $argv[2]; or return 1
omf.install --theme $argv[2]; or return 1
end
end
omf.theme $argv[2]
omf.theme $argv[2]
...
@@ -140,7 +140,7 @@ function omf -d "Oh My Fish"
...
@@ -140,7 +140,7 @@ function omf -d "Oh My Fish"
echo "Please open a new issue here → "(omf::em)"github.com/oh-my-fish/oh-my-fish/issues"(omf::off)
echo "Please open a new issue here → "(omf::em)"github.com/oh-my-fish/oh-my-fish/issues"(omf::off)
end
end
omf.theme (cat $OMF_CONFIG/theme)
omf.theme (cat $OMF_CONFIG/theme)
omf.install_package (omf.
list_installed_packages
)
omf.install_package (omf.
packages.list --installed --plugin
)
refresh
refresh
case "*"
case "*"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment