Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion nb
Original file line number Diff line number Diff line change
Expand Up @@ -5483,12 +5483,21 @@ _list() {
local _use_pager=0
local _with_pinned=0

if [ -t 1 ]; then
_COLOR_ENABLED=1
else
_COLOR_ENABLED=0
fi

while ((${#}))
do
case "${1:-}" in
-a|--all)
_limit=
;;
--color)
_COLOR_ENABLED=1
;;
-e|--excerpt)
_print_excerpt=1
_recursive_arguments+=("--excerpt")
Expand Down Expand Up @@ -8547,11 +8556,17 @@ HEREDOC
local _options=()
local _query_names=()

if [ -t 1 ]; then
_notebook_color_enabled=1
else
_notebook_color_enabled=0
fi

local __arg=
for __arg in "${@:-}"
do
case "${__arg}" in
--archived|--global|--local|--name*|--no*color|--path*|--unarchived)
--archived|--color|--global|--local|--name*|--no*color|--path*|--unarchived)
_options+=("${__arg}")
;;
esac
Expand All @@ -8560,6 +8575,9 @@ HEREDOC
--ar|--archived)
_only_archived=1
;;
--color)
_notebook_color_enabled=1
;;
--global)
_only_global=1
;;
Expand Down Expand Up @@ -8933,12 +8951,21 @@ HEREDOC
local _selector=
local _test_archived=0

if [ -t 1 ]; then
_notebook_color_enabled=1
else
_notebook_color_enabled=0
fi

while ((${#}))
do
case "${1:-}" in
--archived)
_test_archived=1
;;
--color)
_notebook_color_enabled=1
;;
--escaped)
_print_escaped_name=1
;;
Expand Down Expand Up @@ -9706,6 +9733,12 @@ _parse_options() {
local _non_option_arguments=()
local _previous_option=

if [ -t 1 ]; then
_COLOR_ENABLED=1
else
_COLOR_ENABLED=0
fi

while ((${#}))
do
_previous_option="${_current_option:-}"
Expand Down Expand Up @@ -9746,6 +9779,9 @@ _parse_options() {
;;
esac
;;
--color)
_COLOR_ENABLED=1
;;
--debug)
_USE_DEBUG=1
;;
Expand Down Expand Up @@ -12842,12 +12878,21 @@ _add() {
local _template=
local _title=

if [ -t 1 ]; then
_COLOR_ENABLED=1
else
_COLOR_ENABLED=0
fi

while ((${#}))
do
case "${1:-}" in
-b|-br|--browse)
_browse=1
;;
--color)
_COLOR_ENABLED=1
;;
-c|--content)
if [[ -z "${2:-}" ]]
then
Expand Down Expand Up @@ -17247,6 +17292,12 @@ _search() {
local _sort=0
local _type=

if [ -t 1 ]; then
_COLOR_ENABLED=1
else
_COLOR_ENABLED=0
fi

while ((${#}))
do
case "${1:-}" in
Expand Down Expand Up @@ -17295,6 +17346,9 @@ _search() {
shift
fi
;;
--color)
_COLOR_ENABLED=1
;;
--limit|-n|--num|--number|--per*)
_limit="$(_option_get_value "${1}" "${2:-}")"

Expand Down Expand Up @@ -18711,6 +18765,12 @@ _show() {
local _type=
local _unresolved_arguments=()

if [ -t 1 ]; then
_COLOR_ENABLED=1
else
_COLOR_ENABLED=0
fi

while ((${#}))
do
case "${1:-}" in
Expand All @@ -18724,6 +18784,9 @@ _show() {
-b|--br|--browse)
_browse=1
;;
--color)
_COLOR_ENABLED=1
;;
--filename|--basename)
_print_filename=1
_skip_notebook_fallback=1
Expand Down