2013-02-18 23:35:43 +00:00
/ *
Copyright 2013 The Camlistore Authors .
Licensed under the Apache License , Version 2.0 ( the "License" ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
http : //www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing , software
distributed under the License is distributed on an "AS IS" BASIS ,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
See the License for the specific language governing permissions and
limitations under the License .
* /
package main
import (
2014-02-09 23:48:07 +00:00
"net/http"
"camlistore.org/pkg/client"
2013-02-18 23:35:43 +00:00
"camlistore.org/pkg/cmdmain"
)
func main ( ) {
2013-02-27 21:04:08 +00:00
cmdmain . Main ( )
2013-02-18 23:35:43 +00:00
}
2014-02-09 23:48:07 +00:00
const serverFlagHelp = "Format is is either a URL prefix (with optional path), a host[:port], a config file server alias, or blank to use the Camlistore client config's default server."
// newClient returns a Camlistore client for the server.
// The server may be:
// * blank, to use the default in the config file
// * an alias, to use that named alias in the config file
// * host:port
// * https?://host[:port][/path]
func newClient ( server string ) * client . Client {
var cl * client . Client
if server == "" {
cl = client . NewOrFail ( )
} else {
cl = client . New ( server )
}
cl . SetHTTPClient ( & http . Client {
Transport : cl . TransportForConfig ( nil ) ,
} )
cl . SetupAuth ( )
return cl
}