Fossil SCM
completed work on ticket command, optimized the help text
Commit
d6be2068d3193524aeb78528394dd9375edb7ed7
Parent
08726b95be4cba6…
1 file changed
+10
-8
+10
-8
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -843,18 +843,20 @@ | ||
| 843 | 843 | ** |
| 844 | 844 | ** options can be: |
| 845 | 845 | ** ?-l|--limit LIMITCHAR? |
| 846 | 846 | ** ?-q|--quote? |
| 847 | 847 | ** |
| 848 | -** Run the the ticket report, identified by the report title | |
| 848 | +** Run the the ticket report, identified by the report format title | |
| 849 | 849 | ** used in the gui. The data is written as flat file on stdout, |
| 850 | 850 | ** using "," as separator. The seperator "," can be changed using |
| 851 | 851 | ** the -l or --limit option. |
| 852 | 852 | ** If TICKETFILTER is given on the commandline, the query is |
| 853 | 853 | ** limited with a new WHERE-condition. |
| 854 | 854 | ** example: Report lists a column # with the uuid |
| 855 | 855 | ** TICKETFILTER may be [#]='uuuuuuuuu' |
| 856 | +** example: Report only lists rows with status not open | |
| 857 | +** TICKETFILTER: status != 'open' | |
| 856 | 858 | ** If the option -q|--quote is used, the tickets are encoded by |
| 857 | 859 | ** quoting special chars(space -> \\s, tab -> \\t, newline -> \\n, |
| 858 | 860 | ** cr -> \\r, formfeed -> \\f, vtab -> \\v, nul -> \\0, \\ -> \\\\). |
| 859 | 861 | ** Otherwise, the simplified encoding as on the show report raw |
| 860 | 862 | ** page in the gui is used. |
| @@ -861,13 +863,13 @@ | ||
| 861 | 863 | ** |
| 862 | 864 | ** Instead of the report title its possible to use the report |
| 863 | 865 | ** number. Using the special report number 0 list all columns, |
| 864 | 866 | ** defined in the ticket table. |
| 865 | 867 | ** |
| 866 | -** %fossil ticket list | |
| 868 | +** %fossil ticket fieldlist | |
| 867 | 869 | ** |
| 868 | -** list all columns, defined in the ticket table | |
| 870 | +** list all fields, defined for ticket in the fossil repository | |
| 869 | 871 | ** |
| 870 | 872 | ** %fossil ticket set TICKETUUID FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 871 | 873 | ** %fossil ticket change TICKETUUID FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 872 | 874 | ** |
| 873 | 875 | ** change ticket identified by TICKETUUID and set the value of |
| @@ -877,11 +879,11 @@ | ||
| 877 | 879 | ** Field names given above are the ones, defined in a standard |
| 878 | 880 | ** fossil environment. If you have added, deleted columns, you |
| 879 | 881 | ** change the all your configured columns. |
| 880 | 882 | ** You can use more than one field/value pair on the commandline. |
| 881 | 883 | ** Using -q|--quote enables the special character decoding as |
| 882 | -** in "ticket list". So it's possible, to set multiline text or | |
| 884 | +** in "ticket show". So it's possible, to set multiline text or | |
| 883 | 885 | ** text with special characters. |
| 884 | 886 | ** |
| 885 | 887 | ** %fossil ticket add FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 886 | 888 | ** |
| 887 | 889 | ** like set, but create a new ticket with the given values. |
| @@ -902,17 +904,17 @@ | ||
| 902 | 904 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 903 | 905 | fossil_fatal("no such user: %s", g.zLogin); |
| 904 | 906 | } |
| 905 | 907 | |
| 906 | 908 | if( g.argc<3 ){ |
| 907 | - usage("add|list|set|show"); | |
| 909 | + usage("add|fieldlist|set|show"); | |
| 908 | 910 | }else{ |
| 909 | 911 | n = strlen(g.argv[2]); |
| 910 | 912 | if( n==1 && g.argv[2][0]=='s' ){ |
| 911 | 913 | /* set/show cannot be distinguished, so show the usage */ |
| 912 | - usage("add|list|set|show"); | |
| 913 | - }else if( strncmp(g.argv[2],"list",n)==0 ){ | |
| 914 | + usage("add|fieldlist|set|show"); | |
| 915 | + }else if( strncmp(g.argv[2],"fieldlist",n)==0 ){ | |
| 914 | 916 | /* simply show all field names */ |
| 915 | 917 | int i; |
| 916 | 918 | |
| 917 | 919 | /* read all available ticket fields */ |
| 918 | 920 | getAllTicketFields(); |
| @@ -971,11 +973,11 @@ | ||
| 971 | 973 | i = 3; |
| 972 | 974 | zTktUuid = db_text(0, "SELECT lower(hex(randomblob(20)))"); |
| 973 | 975 | } |
| 974 | 976 | /* none of set/add, so show the usage! */ |
| 975 | 977 | if( eCmd==err ){ |
| 976 | - usage("add|list|set|show"); | |
| 978 | + usage("add|fieldlist|set|show"); | |
| 977 | 979 | } |
| 978 | 980 | |
| 979 | 981 | /* read all given ticket field/value pairs from command line */ |
| 980 | 982 | if( i==g.argc ){ |
| 981 | 983 | fossil_fatal("empty %s command aborted!",g.argv[2]); |
| 982 | 984 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -843,18 +843,20 @@ | |
| 843 | ** |
| 844 | ** options can be: |
| 845 | ** ?-l|--limit LIMITCHAR? |
| 846 | ** ?-q|--quote? |
| 847 | ** |
| 848 | ** Run the the ticket report, identified by the report title |
| 849 | ** used in the gui. The data is written as flat file on stdout, |
| 850 | ** using "," as separator. The seperator "," can be changed using |
| 851 | ** the -l or --limit option. |
| 852 | ** If TICKETFILTER is given on the commandline, the query is |
| 853 | ** limited with a new WHERE-condition. |
| 854 | ** example: Report lists a column # with the uuid |
| 855 | ** TICKETFILTER may be [#]='uuuuuuuuu' |
| 856 | ** If the option -q|--quote is used, the tickets are encoded by |
| 857 | ** quoting special chars(space -> \\s, tab -> \\t, newline -> \\n, |
| 858 | ** cr -> \\r, formfeed -> \\f, vtab -> \\v, nul -> \\0, \\ -> \\\\). |
| 859 | ** Otherwise, the simplified encoding as on the show report raw |
| 860 | ** page in the gui is used. |
| @@ -861,13 +863,13 @@ | |
| 861 | ** |
| 862 | ** Instead of the report title its possible to use the report |
| 863 | ** number. Using the special report number 0 list all columns, |
| 864 | ** defined in the ticket table. |
| 865 | ** |
| 866 | ** %fossil ticket list |
| 867 | ** |
| 868 | ** list all columns, defined in the ticket table |
| 869 | ** |
| 870 | ** %fossil ticket set TICKETUUID FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 871 | ** %fossil ticket change TICKETUUID FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 872 | ** |
| 873 | ** change ticket identified by TICKETUUID and set the value of |
| @@ -877,11 +879,11 @@ | |
| 877 | ** Field names given above are the ones, defined in a standard |
| 878 | ** fossil environment. If you have added, deleted columns, you |
| 879 | ** change the all your configured columns. |
| 880 | ** You can use more than one field/value pair on the commandline. |
| 881 | ** Using -q|--quote enables the special character decoding as |
| 882 | ** in "ticket list". So it's possible, to set multiline text or |
| 883 | ** text with special characters. |
| 884 | ** |
| 885 | ** %fossil ticket add FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 886 | ** |
| 887 | ** like set, but create a new ticket with the given values. |
| @@ -902,17 +904,17 @@ | |
| 902 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 903 | fossil_fatal("no such user: %s", g.zLogin); |
| 904 | } |
| 905 | |
| 906 | if( g.argc<3 ){ |
| 907 | usage("add|list|set|show"); |
| 908 | }else{ |
| 909 | n = strlen(g.argv[2]); |
| 910 | if( n==1 && g.argv[2][0]=='s' ){ |
| 911 | /* set/show cannot be distinguished, so show the usage */ |
| 912 | usage("add|list|set|show"); |
| 913 | }else if( strncmp(g.argv[2],"list",n)==0 ){ |
| 914 | /* simply show all field names */ |
| 915 | int i; |
| 916 | |
| 917 | /* read all available ticket fields */ |
| 918 | getAllTicketFields(); |
| @@ -971,11 +973,11 @@ | |
| 971 | i = 3; |
| 972 | zTktUuid = db_text(0, "SELECT lower(hex(randomblob(20)))"); |
| 973 | } |
| 974 | /* none of set/add, so show the usage! */ |
| 975 | if( eCmd==err ){ |
| 976 | usage("add|list|set|show"); |
| 977 | } |
| 978 | |
| 979 | /* read all given ticket field/value pairs from command line */ |
| 980 | if( i==g.argc ){ |
| 981 | fossil_fatal("empty %s command aborted!",g.argv[2]); |
| 982 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -843,18 +843,20 @@ | |
| 843 | ** |
| 844 | ** options can be: |
| 845 | ** ?-l|--limit LIMITCHAR? |
| 846 | ** ?-q|--quote? |
| 847 | ** |
| 848 | ** Run the the ticket report, identified by the report format title |
| 849 | ** used in the gui. The data is written as flat file on stdout, |
| 850 | ** using "," as separator. The seperator "," can be changed using |
| 851 | ** the -l or --limit option. |
| 852 | ** If TICKETFILTER is given on the commandline, the query is |
| 853 | ** limited with a new WHERE-condition. |
| 854 | ** example: Report lists a column # with the uuid |
| 855 | ** TICKETFILTER may be [#]='uuuuuuuuu' |
| 856 | ** example: Report only lists rows with status not open |
| 857 | ** TICKETFILTER: status != 'open' |
| 858 | ** If the option -q|--quote is used, the tickets are encoded by |
| 859 | ** quoting special chars(space -> \\s, tab -> \\t, newline -> \\n, |
| 860 | ** cr -> \\r, formfeed -> \\f, vtab -> \\v, nul -> \\0, \\ -> \\\\). |
| 861 | ** Otherwise, the simplified encoding as on the show report raw |
| 862 | ** page in the gui is used. |
| @@ -861,13 +863,13 @@ | |
| 863 | ** |
| 864 | ** Instead of the report title its possible to use the report |
| 865 | ** number. Using the special report number 0 list all columns, |
| 866 | ** defined in the ticket table. |
| 867 | ** |
| 868 | ** %fossil ticket fieldlist |
| 869 | ** |
| 870 | ** list all fields, defined for ticket in the fossil repository |
| 871 | ** |
| 872 | ** %fossil ticket set TICKETUUID FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 873 | ** %fossil ticket change TICKETUUID FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 874 | ** |
| 875 | ** change ticket identified by TICKETUUID and set the value of |
| @@ -877,11 +879,11 @@ | |
| 879 | ** Field names given above are the ones, defined in a standard |
| 880 | ** fossil environment. If you have added, deleted columns, you |
| 881 | ** change the all your configured columns. |
| 882 | ** You can use more than one field/value pair on the commandline. |
| 883 | ** Using -q|--quote enables the special character decoding as |
| 884 | ** in "ticket show". So it's possible, to set multiline text or |
| 885 | ** text with special characters. |
| 886 | ** |
| 887 | ** %fossil ticket add FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote? |
| 888 | ** |
| 889 | ** like set, but create a new ticket with the given values. |
| @@ -902,17 +904,17 @@ | |
| 904 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 905 | fossil_fatal("no such user: %s", g.zLogin); |
| 906 | } |
| 907 | |
| 908 | if( g.argc<3 ){ |
| 909 | usage("add|fieldlist|set|show"); |
| 910 | }else{ |
| 911 | n = strlen(g.argv[2]); |
| 912 | if( n==1 && g.argv[2][0]=='s' ){ |
| 913 | /* set/show cannot be distinguished, so show the usage */ |
| 914 | usage("add|fieldlist|set|show"); |
| 915 | }else if( strncmp(g.argv[2],"fieldlist",n)==0 ){ |
| 916 | /* simply show all field names */ |
| 917 | int i; |
| 918 | |
| 919 | /* read all available ticket fields */ |
| 920 | getAllTicketFields(); |
| @@ -971,11 +973,11 @@ | |
| 973 | i = 3; |
| 974 | zTktUuid = db_text(0, "SELECT lower(hex(randomblob(20)))"); |
| 975 | } |
| 976 | /* none of set/add, so show the usage! */ |
| 977 | if( eCmd==err ){ |
| 978 | usage("add|fieldlist|set|show"); |
| 979 | } |
| 980 | |
| 981 | /* read all given ticket field/value pairs from command line */ |
| 982 | if( i==g.argc ){ |
| 983 | fossil_fatal("empty %s command aborted!",g.argv[2]); |
| 984 |