update the command description

This commit is contained in:
MaysWind
2026-03-04 22:37:55 +08:00
parent 973cec2c6a
commit b729fdedca
2 changed files with 31 additions and 31 deletions
+15 -15
View File
@@ -27,7 +27,7 @@ $script:EBKTOOL_TOKEN = $env:EBKTOOL_TOKEN
$API_CONFIGS = @( $API_CONFIGS = @(
@{ @{
Name = "tokens-list" Name = "tokens-list"
Description = "Get available sessions information" Description = "Retrieve all sessions for the current user"
Method = "GET" Method = "GET"
Path = "tokens/list.json" Path = "tokens/list.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -53,7 +53,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "tokens-revoke" Name = "tokens-revoke"
Description = "Revoke token" Description = "Revoke a specified token"
Method = "POST" Method = "POST"
Path = "tokens/revoke.json" Path = "tokens/revoke.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -71,7 +71,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "accounts-list" Name = "accounts-list"
Description = "Get all accounts list" Description = "Retrieve all account information"
Method = "GET" Method = "GET"
Path = "accounts/list.json" Path = "accounts/list.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -109,7 +109,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "accounts-add" Name = "accounts-add"
Description = "Add account" Description = "Add a new account"
Method = "POST" Method = "POST"
Path = "accounts/add.json" Path = "accounts/add.json"
RequiresTimezone = $true RequiresTimezone = $true
@@ -162,7 +162,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "transaction-categories-list" Name = "transaction-categories-list"
Description = "Get all transaction categories" Description = "Retrieve all available transaction categories"
Method = "GET" Method = "GET"
Path = "transaction/categories/list.json" Path = "transaction/categories/list.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -196,7 +196,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "transaction-categories-add" Name = "transaction-categories-add"
Description = "Add transaction category" Description = "Add a new transaction category"
Method = "POST" Method = "POST"
Path = "transaction/categories/add.json" Path = "transaction/categories/add.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -235,7 +235,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "transaction-tags-list" Name = "transaction-tags-list"
Description = "Get all transaction tags list" Description = "Retrieve all available transaction tags"
Method = "GET" Method = "GET"
Path = "transaction/tags/list.json" Path = "transaction/tags/list.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -261,7 +261,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "transaction-tags-add" Name = "transaction-tags-add"
Description = "Add transaction tag" Description = "Add a new transaction tag"
Method = "POST" Method = "POST"
Path = "transaction/tags/add.json" Path = "transaction/tags/add.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -287,7 +287,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "transactions-list" Name = "transactions-list"
Description = "Get transactions list with pagination" Description = "Retrieve transaction data based on specified query criteria (with pagination support)"
Method = "GET" Method = "GET"
Path = "transactions/list.json" Path = "transactions/list.json"
RequiresTimezone = $true RequiresTimezone = $true
@@ -369,7 +369,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "transactions-list-all" Name = "transactions-list-all"
Description = "Get all transactions list" Description = "Retrieve all transaction data matching the specified query criteria"
Method = "GET" Method = "GET"
Path = "transactions/list/all.json" Path = "transactions/list/all.json"
RequiresTimezone = $true RequiresTimezone = $true
@@ -436,7 +436,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "transactions-add" Name = "transactions-add"
Description = "Add transaction" Description = "Add a new transaction"
Method = "POST" Method = "POST"
Path = "transactions/add.json" Path = "transactions/add.json"
RequiresTimezone = $true RequiresTimezone = $true
@@ -499,7 +499,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "exchangerates-latest" Name = "exchangerates-latest"
Description = "Get latest exchange rates" Description = "Retrieve the latest exchange rate data"
Method = "GET" Method = "GET"
Path = "exchange_rates/latest.json" Path = "exchange_rates/latest.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -534,7 +534,7 @@ $API_CONFIGS = @(
} }
@{ @{
Name = "server-version" Name = "server-version"
Description = "Get ezBookkeeping server version information" Description = "Retrieve ezBookkeeping server version information"
Method = "GET" Method = "GET"
Path = "systems/version.json" Path = "systems/version.json"
RequiresTimezone = $false RequiresTimezone = $false
@@ -1169,7 +1169,7 @@ function Show-Help {
Write-Host " EBKTOOL_SERVER_BASEURL ezBookkeeping server base URL (e.g., http://localhost:8080)" Write-Host " EBKTOOL_SERVER_BASEURL ezBookkeeping server base URL (e.g., http://localhost:8080)"
Write-Host " EBKTOOL_TOKEN ezBookkeeping API token" Write-Host " EBKTOOL_TOKEN ezBookkeeping API token"
Write-Host "" Write-Host ""
Write-Host " You can also set the above environment variables in a .env file located in the current directory, parent directory or home directory." Write-Host " You can also set the above environment variables in a '.env' file located in the current directory, parent directory or home directory."
Write-Host "" Write-Host ""
Write-Host "Global Options:" Write-Host "Global Options:"
Write-Host " -tzName <name> The IANA timezone name of current timezone. For example, for Beijing Time it is 'Asia/Shanghai'." Write-Host " -tzName <name> The IANA timezone name of current timezone. For example, for Beijing Time it is 'Asia/Shanghai'."
@@ -1212,7 +1212,7 @@ function Show-CommandList {
} }
Write-Host "" Write-Host ""
Write-Host "Use 'ebktools.ps1 help <api-command>' to see detailed information about a API command." Write-Host "Use 'ebktools.ps1 help <api-command>' to see detailed information about an API command."
} }
function Show-CommandHelp { function Show-CommandHelp {
+16 -16
View File
@@ -7,7 +7,7 @@
API_CONFIGS='[ API_CONFIGS='[
{ {
"Name": "tokens-list", "Name": "tokens-list",
"Description": "Get available sessions information", "Description": "Retrieve all sessions for the current user",
"Method": "GET", "Method": "GET",
"Path": "tokens/list.json", "Path": "tokens/list.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -33,7 +33,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "tokens-revoke", "Name": "tokens-revoke",
"Description": "Revoke token", "Description": "Revoke a specified token",
"Method": "POST", "Method": "POST",
"Path": "tokens/revoke.json", "Path": "tokens/revoke.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -51,7 +51,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "accounts-list", "Name": "accounts-list",
"Description": "Get all accounts list", "Description": "Retrieve all account information",
"Method": "GET", "Method": "GET",
"Path": "accounts/list.json", "Path": "accounts/list.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -89,7 +89,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "accounts-add", "Name": "accounts-add",
"Description": "Add account", "Description": "Add a new account",
"Method": "POST", "Method": "POST",
"Path": "accounts/add.json", "Path": "accounts/add.json",
"RequiresTimezone": true, "RequiresTimezone": true,
@@ -142,7 +142,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "transaction-categories-list", "Name": "transaction-categories-list",
"Description": "Get all transaction categories", "Description": "Retrieve all available transaction categories",
"Method": "GET", "Method": "GET",
"Path": "transaction/categories/list.json", "Path": "transaction/categories/list.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -176,7 +176,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "transaction-categories-add", "Name": "transaction-categories-add",
"Description": "Add transaction category", "Description": "Add a new transaction category",
"Method": "POST", "Method": "POST",
"Path": "transaction/categories/add.json", "Path": "transaction/categories/add.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -215,7 +215,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "transaction-tags-list", "Name": "transaction-tags-list",
"Description": "Get all transaction tags list", "Description": "Retrieve all available transaction tags",
"Method": "GET", "Method": "GET",
"Path": "transaction/tags/list.json", "Path": "transaction/tags/list.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -241,7 +241,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "transaction-tags-add", "Name": "transaction-tags-add",
"Description": "Add transaction tag", "Description": "Add a new transaction tag",
"Method": "POST", "Method": "POST",
"Path": "transaction/tags/add.json", "Path": "transaction/tags/add.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -267,7 +267,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "transactions-list", "Name": "transactions-list",
"Description": "Get transactions list with pagination", "Description": "Retrieve transaction data based on specified query criteria (with pagination support)",
"Method": "GET", "Method": "GET",
"Path": "transactions/list.json", "Path": "transactions/list.json",
"RequiresTimezone": true, "RequiresTimezone": true,
@@ -349,7 +349,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "transactions-list-all", "Name": "transactions-list-all",
"Description": "Get all transactions list", "Description": "Retrieve all transaction data matching the specified query criteria",
"Method": "GET", "Method": "GET",
"Path": "transactions/list/all.json", "Path": "transactions/list/all.json",
"RequiresTimezone": true, "RequiresTimezone": true,
@@ -416,7 +416,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "transactions-add", "Name": "transactions-add",
"Description": "Add transaction", "Description": "Add a new transaction",
"Method": "POST", "Method": "POST",
"Path": "transactions/add.json", "Path": "transactions/add.json",
"RequiresTimezone": true, "RequiresTimezone": true,
@@ -479,7 +479,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "exchangerates-latest", "Name": "exchangerates-latest",
"Description": "Get latest exchange rates", "Description": "Retrieve the latest exchange rate data",
"Method": "GET", "Method": "GET",
"Path": "exchange_rates/latest.json", "Path": "exchange_rates/latest.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -514,7 +514,7 @@ API_CONFIGS='[
}, },
{ {
"Name": "server-version", "Name": "server-version",
"Description": "Get ezBookkeeping server version information", "Description": "Retrieve ezBookkeeping server version information",
"Method": "GET", "Method": "GET",
"Path": "systems/version.json", "Path": "systems/version.json",
"RequiresTimezone": false, "RequiresTimezone": false,
@@ -817,7 +817,7 @@ Environment Variables (Required):
EBKTOOL_SERVER_BASEURL ezBookkeeping server base URL (e.g., http://localhost:8080) EBKTOOL_SERVER_BASEURL ezBookkeeping server base URL (e.g., http://localhost:8080)
EBKTOOL_TOKEN ezBookkeeping API token EBKTOOL_TOKEN ezBookkeeping API token
You can also set the above environment variables in a .env file located in the current directory, parent directory or home directory. You can also set the above environment variables in a '.env' file located in the current directory, parent directory or home directory.
Global Options: Global Options:
--tz-name <name> The IANA timezone name of current timezone. For example, for Beijing Time it is 'Asia/Shanghai'. --tz-name <name> The IANA timezone name of current timezone. For example, for Beijing Time it is 'Asia/Shanghai'.
@@ -860,7 +860,7 @@ list_commands() {
done done
echo "" echo ""
echo "Use 'ebktools.sh help <api-command>' to see detailed information about a API command." echo "Use 'ebktools.sh help <api-command>' to see detailed information about an API command."
} }
show_command_help() { show_command_help() {
@@ -1000,7 +1000,7 @@ call_api() {
case "$param_type" in case "$param_type" in
integer) integer)
if ! echo "$param_value" | grep -Eq '^-?[0-9]+$'; then if ! echo "$param_value" | grep -Eq '^-?[0-9]+$'; then
echo_red "Error: Parameter '--${param_name}' must be a integer value" echo_red "Error: Parameter '--${param_name}' must be an integer value"
exit 1 exit 1
fi fi
;; ;;