add: option to disable last_id

This commit is contained in:
mrjk 2023-04-17 14:41:24 -04:00
parent 004b471d9d
commit d5805041f5

View File

@ -112,7 +112,6 @@ idm_id__show ()
idm_id__ls () idm_id__ls ()
{ {
local active local active
#set -x
for id in $(lib_id_get_all_id); do for id in $(lib_id_get_all_id); do
@ -134,6 +133,12 @@ idm_id__ls ()
done | column -t -s: -o' ' #| lib_log DUMP - done | column -t -s: -o' ' #| lib_log DUMP -
} }
# List all available IDs names
idm_id__names ()
{
lib_id_get_all_id | xargs
}
idm_id__edit () idm_id__edit ()
{ {
@ -206,6 +211,7 @@ idm_id__rm ()
idm_id_save_last_id () idm_id_save_last_id ()
{ {
local id=${1} local id=${1}
[[ "${IDM_LAST_ID_SAVE:-true}" == "true" ]] || return 0
echo "$id" > "$IDM_DIR_CACHE/last_id" echo "$id" > "$IDM_DIR_CACHE/last_id"
} }