Fix sf-org-info two-character options: standardize to -lm/-ls, update docs and tests
This commit is contained in:
43
sf-org-info
43
sf-org-info
@@ -6,10 +6,11 @@ show_help() {
|
||||
sf-org-info — wrapper for quick org information display
|
||||
|
||||
USAGE:
|
||||
sf-org-info [-to <ORG_ALIAS>] [-ve] [-ls] [-hp]
|
||||
sf-org-info [-to <ORG_ALIAS>] [-lm] [-ve] [-ls] [-hp]
|
||||
|
||||
OPTIONS:
|
||||
-to Target org alias or username (if not provided, uses default org)
|
||||
-lm Show detailed org limits information
|
||||
-ve Verbose output (show detailed information)
|
||||
-ls List all authenticated orgs
|
||||
-hp Show this help
|
||||
@@ -21,10 +22,13 @@ EXAMPLES:
|
||||
2) Show specific org info:
|
||||
sf-org-info -to DEMO-ORG
|
||||
|
||||
3) Show detailed org information:
|
||||
3) Show org limits:
|
||||
sf-org-info -to DEMO-ORG -lm
|
||||
|
||||
4) Show detailed org information:
|
||||
sf-org-info -to DEMO-ORG -ve
|
||||
|
||||
4) List all authenticated orgs:
|
||||
5) List all authenticated orgs:
|
||||
sf-org-info -ls
|
||||
|
||||
DISPLAYED INFORMATION:
|
||||
@@ -47,6 +51,13 @@ EOF
|
||||
ORG=""
|
||||
VERBOSE=false
|
||||
LIST_ORGS=false
|
||||
SHOW_LIMITS=false
|
||||
|
||||
# Show help if no arguments provided (consistent with PowerShell version)
|
||||
if [[ $# -eq 0 ]]; then
|
||||
show_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Parse arguments manually for two-character options
|
||||
while [[ $# -gt 0 ]]; do
|
||||
@@ -61,11 +72,15 @@ while [[ $# -gt 0 ]]; do
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
-lm)
|
||||
SHOW_LIMITS=true
|
||||
shift
|
||||
;;
|
||||
-ve|--verbose)
|
||||
VERBOSE=true
|
||||
shift
|
||||
;;
|
||||
-ls|--list)
|
||||
-ls)
|
||||
LIST_ORGS=true
|
||||
shift
|
||||
;;
|
||||
@@ -184,6 +199,25 @@ if ! show_org_info "$ORG"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Show limits if requested
|
||||
if [[ "$SHOW_LIMITS" == "true" ]]; then
|
||||
echo
|
||||
echo "📈 Organization Limits:"
|
||||
echo "======================="
|
||||
|
||||
cmd_args=()
|
||||
if [[ -n "$ORG" ]]; then
|
||||
cmd_args+=(--target-org "$ORG")
|
||||
fi
|
||||
|
||||
if sf org list limits ${cmd_args[@]:+"${cmd_args[@]}"} 2>/dev/null; then
|
||||
echo
|
||||
else
|
||||
echo "❌ Unable to retrieve org limits"
|
||||
echo "Make sure you're authenticated and the org exists."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "✅ Org information displayed successfully!"
|
||||
|
||||
@@ -192,4 +226,5 @@ echo
|
||||
echo "💡 Helpful commands:"
|
||||
echo " - Open this org: sf org open${ORG:+ --target-org \"$ORG\"}"
|
||||
echo " - List all orgs: sf-org-info -ls"
|
||||
echo " - Show limits: sf-org-info${ORG:+ -to \"$ORG\"} -lm"
|
||||
echo " - Detailed info: sf-org-info${ORG:+ -to \"$ORG\"} -ve"
|
||||
|
||||
Reference in New Issue
Block a user