Commit 7b049b9
fix(cli): enable interspersed option parsing for cloud_run command
The `cloud_run` CLI command was rejecting documented debug options (e.g., `--verbosity DEBUG`, `--log_level DEBUG`) when placed after positional arguments like `AGENT`, returning `Error: Unexpected arguments: --verbosity DEBUG`.
Root Cause:
The command definition previously disabled interspersed arguments (`allow_interspersed_args=False`), forcing manual parsing of the `--` separator to pass extra arguments to `gcloud`. This manual parsing was unnecessary and over-engineered, as Click natively consumes the `--` separator and delegates extra argument collection automatically when interspersed parsing is enabled.
Solution:
1. Removed `allow_interspersed_args=False` from `context_settings` in `src/google/adk/cli/cli_tools_click.py` to allow Click's default interspersed option parsing.
2. Removed the obsolete manual `--` separator parsing logic, simplifying `gcloud_args` collection directly to `ctx.args`.
Merge #4563
Original PR by @khushi0433 (khushbu_baloch <fatimahbaloch917@gmail.com>)
Co-authored-by: Yi Liu <yiliuly@google.com>
COPYBARA_INTEGRATE_REVIEW=#4563 from khushi0433:fix-cloud-run-verbosity 72b3485
PiperOrigin-RevId: 9374245671 parent 62b9700 commit 7b049b9
2 files changed
Lines changed: 54 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2000 | 2000 | | |
2001 | 2001 | | |
2002 | 2002 | | |
2003 | | - | |
2004 | 2003 | | |
2005 | 2004 | | |
2006 | 2005 | | |
| |||
2177 | 2176 | | |
2178 | 2177 | | |
2179 | 2178 | | |
2180 | | - | |
2181 | | - | |
2182 | | - | |
2183 | | - | |
2184 | | - | |
2185 | | - | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
2196 | | - | |
2197 | | - | |
2198 | | - | |
2199 | | - | |
2200 | | - | |
2201 | | - | |
2202 | | - | |
2203 | | - | |
2204 | | - | |
2205 | | - | |
2206 | | - | |
2207 | | - | |
| 2179 | + | |
2208 | 2180 | | |
2209 | 2181 | | |
2210 | 2182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | | - | |
| 889 | + | |
890 | 890 | | |
891 | 891 | | |
892 | | - | |
| 892 | + | |
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
896 | | - | |
| 896 | + | |
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
| 909 | + | |
| 910 | + | |
910 | 911 | | |
911 | 912 | | |
912 | 913 | | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
917 | 921 | | |
918 | 922 | | |
919 | | - | |
| 923 | + | |
920 | 924 | | |
921 | 925 | | |
922 | | - | |
| 926 | + | |
923 | 927 | | |
924 | 928 | | |
925 | 929 | | |
926 | | - | |
| 930 | + | |
927 | 931 | | |
928 | 932 | | |
929 | 933 | | |
930 | 934 | | |
931 | 935 | | |
932 | 936 | | |
933 | 937 | | |
| 938 | + | |
934 | 939 | | |
935 | 940 | | |
936 | 941 | | |
937 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
938 | 971 | | |
939 | | - | |
940 | | - | |
941 | 972 | | |
| 973 | + | |
942 | 974 | | |
943 | 975 | | |
944 | 976 | | |
945 | 977 | | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
| 978 | + | |
950 | 979 | | |
951 | 980 | | |
952 | 981 | | |
953 | | - | |
| 982 | + | |
954 | 983 | | |
955 | 984 | | |
956 | | - | |
| 985 | + | |
957 | 986 | | |
958 | 987 | | |
959 | 988 | | |
960 | | - | |
| 989 | + | |
961 | 990 | | |
962 | 991 | | |
963 | 992 | | |
| |||
967 | 996 | | |
968 | 997 | | |
969 | 998 | | |
970 | | - | |
971 | | - | |
972 | 999 | | |
| 1000 | + | |
973 | 1001 | | |
974 | | - | |
| 1002 | + | |
975 | 1003 | | |
976 | 1004 | | |
977 | 1005 | | |
978 | 1006 | | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
| 1007 | + | |
| 1008 | + | |
985 | 1009 | | |
986 | 1010 | | |
987 | 1011 | | |
| |||
0 commit comments