Subversion Repositories Koakuma

Rev

Rev 12 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12 Rev 19
Line 1... Line 1...
1
#!/usr/bin/env tclsh
1
#!/usr/bin/env tclsh
2
# $Id: create-project.in 12 2024-10-02 03:25:33Z nishi $
2
# $Id: create-project.in 19 2024-10-02 07:44:13Z nishi $
3
package require tdom
3
package require tdom
4
foreach path [glob "@@PREFIX@@/lib/koakuma/utility/*.tcl"] {
4
foreach path [glob "@@PREFIX@@/lib/koakuma/utility/*.tcl"] {
5
	source $path
5
	source $path
6
}
6
}
-
 
7
set dothis ""
7
foreach arg $argv {
8
foreach arg $argv {
8
	if { [string range "$arg" 0 0] == "-" } {
9
	if { [string range "$arg" 0 0] == "-" } {
9
		if { "$arg" == "-h" || "$arg" == "--help" } {
10
		if { "$arg" == "-h" || "$arg" == "--help" } {
10
			puts "Usage: $argv0"
11
			puts "Usage: $argv0 \[-u username\] \[-p password\] \[-R rpc_url\]"
11
			puts "You can set the environment variable `KOAKUMA_RPC' to override default RPC URL."
12
			puts "You can set the environment variable `KOAKUMA_RPC' to override default RPC URL."
12
			puts "Default: http://127.0.0.1/koakuma/rpc"
13
			puts "Default: http://127.0.0.1/koakuma/rpc"
13
			exit 0
14
			exit 0
-
 
15
		} elseif { "$arg" == "-u" } {
-
 
16
			set dothis "set-username"
-
 
17
		} elseif { "$arg" == "-p" } {
-
 
18
			set dothis "set-password"
-
 
19
		} elseif { "$arg" == "-R" } {
-
 
20
			set dothis "set-rpc"
14
		}
21
		}
-
 
22
	} else {
-
 
23
		if { "$dothis" == "set-username" } {
-
 
24
			::rpc::set-username "$arg"
-
 
25
		} elseif { "$dothis" == "set-password" } {
-
 
26
			::rpc::set-password "$arg"
-
 
27
		} elseif { "$dothis" == "set-rpc" } {
-
 
28
			set RPC_URL "$arg"
-
 
29
		}
-
 
30
		set dothis ""
15
	}
31
	}
16
}
32
}
17
 
33
 
18
::rpc::init
-
 
19
 
-
 
20
dom createNodeCmd -tagName "name" -jsonType NONE elementNode keyName
34
dom createNodeCmd -tagName "name" -jsonType NONE elementNode keyName
21
dom createNodeCmd -tagName "description" -jsonType NONE elementNode keyDescription
35
dom createNodeCmd -tagName "description" -jsonType NONE elementNode keyDescription
22
dom createNodeCmd -tagName "vcs" -jsonType NONE elementNode keyVCS
36
dom createNodeCmd -tagName "vcs" -jsonType NONE elementNode keyVCS
23
dom createNodeCmd -tagName "url" -jsonType NONE elementNode keyURL
37
dom createNodeCmd -tagName "url" -jsonType NONE elementNode keyURL
24
 
38