oode 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
1
+ # This wonderful code taken from http://github.com/michaeldv/awesome_print.
2
+ class String
3
+ [:gray, :red, :green, :yellow, :blue, :purple, :cyan, :white].each_with_index do |color, offset|
4
+ define_method color do "\033[1;#{30+offset}m#{self}\033[0m" end
5
+ define_method :"#{color}ish" do "\033[0;#{30+offset}m#{self}\033[0m" end
6
+ end
7
+ end
8
+
9
+ # Allow numbers to be formatted with human readable data sizes.
10
+ class Numeric
11
+ def to_human
12
+ units = %w{B KB MB GB TB}
13
+ e = (Math.log(self)/Math.log(1024)).floor
14
+ s = "%.3f" % (to_f / 1024**e)
15
+ s.sub(/\.?0*$/, units[e])
16
+ end
17
+ end
18
+
19
+ def error message
20
+ abort "ERROR: #{message}".red
21
+ end
22
+
23
+ def notify message
24
+ puts "INFO: #{message}".yellow
25
+ end
26
+
27
+ def warning message
28
+ puts "WARN: #{message}".purple
29
+ end
@@ -0,0 +1,8 @@
1
+ module Oode
2
+ class Downloader < Transferer
3
+ def download!(path)
4
+ filename = ::File.basename(path)
5
+ @transfer.download! path, "./#{filename}"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,44 @@
1
+ require 'net/ssh'
2
+
3
+ SSH_ERROR = <<ERROR
4
+ Something went wrong with your SSH connection. Please file a bug report at:
5
+
6
+ http://github.com/xoebus/oode/issues
7
+
8
+ with your error message.
9
+ ERROR
10
+
11
+ module Oode
12
+ class Session
13
+ SERVER = 'ssh.inf.ed.ac.uk'
14
+ DEFAULT_HOST = 'student.login'
15
+
16
+ attr_reader :user
17
+
18
+ def initialize(user, options = {})
19
+ @user = user
20
+ @machine = options[:machine] || DEFAULT_HOST
21
+
22
+ begin
23
+ @session = Net::SSH.start(SERVER, user.username, :password => user.password)
24
+ rescue Net::SSH::AuthenticationFailed
25
+ error "Your login credentials were incorrect. Please fix this and try again."
26
+ rescue Net::SSH::Exception
27
+ error SSH_ERROR
28
+ end
29
+ end
30
+
31
+ def connection
32
+ @session
33
+ end
34
+
35
+ def close
36
+ @session.close
37
+ end
38
+
39
+ def exec!(command, options = {})
40
+ host = options[:machine] || @machine
41
+ @session.exec!("ssh #{host} #{command}").chomp
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,10 @@
1
+ require "net/sftp"
2
+
3
+ module Oode
4
+ class Transferer < Session
5
+ def initialize(user, options = {})
6
+ super(user, options)
7
+ @transfer = connection.sftp
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,30 @@
1
+ module Oode
2
+ class Uploader < Transferer
3
+ UPLOAD_FOLDER_NAME = ".oode"
4
+
5
+ def upload!(file, options = {})
6
+ create_upload_folder
7
+
8
+ destination = options[:destination] || file.remote_path
9
+ @transfer.upload! file.path, destination
10
+ end
11
+
12
+ def clean!
13
+ command = "rm -r #{default_upload_path}"
14
+ @session.exec!(command)
15
+ end
16
+
17
+ def default_upload_path
18
+ "#{user.home}/#{UPLOAD_FOLDER_NAME}"
19
+ end
20
+
21
+ def create_upload_folder
22
+ directories = @transfer.dir.entries(user.home)
23
+ directory_names = directories.map { |d| d.name }
24
+
25
+ unless directory_names.include? UPLOAD_FOLDER_NAME
26
+ @transfer.mkdir! default_upload_path
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,82 @@
1
+ SIZE_WARNING = <<WARNING
2
+ Your file is pretty big: (%s).
3
+ It may take a while to print... (don't blame me!)
4
+ WARNING
5
+
6
+ module Oode
7
+ class Printer
8
+ OO_FILETYPES = ['doc', 'docx', 'odf', 'rtf']
9
+
10
+ SIZE_LIMIT = 5242880 # 5MB
11
+ JOB_LIMIT = 5
12
+
13
+ attr_reader :printer_name
14
+ attr_reader :session
15
+ attr_reader :options
16
+
17
+ def initialize(name, session, options = {})
18
+ @printer_name = name
19
+ @session = session
20
+ @options = options
21
+ end
22
+
23
+ def print! file
24
+ check_size file
25
+ check_working
26
+
27
+ command = print_command(file)
28
+ notify "Printing file: #{command}"
29
+ session.exec!(command)
30
+ end
31
+
32
+ private
33
+ def print_command file
34
+ copies = @options[:number] || 1
35
+ has_layout = @options[:format] || nil
36
+
37
+ if OO_FILETYPES.include? file.extension
38
+ if !has_layout.nil? || copies != 1
39
+ warning "Cannot print #{file.basename} with formatting arguments..."
40
+ end
41
+
42
+ "soffice -pt #{printer_name} #{file.remote_path}"
43
+ else
44
+ args = ""
45
+ args << "-# #{copies} " if copies > 1
46
+
47
+ if @options[:format].eql? :four
48
+ args << "-Z 4up "
49
+ elsif @options[:format].eql? :two
50
+ args << "-Z 2up "
51
+ end
52
+
53
+ "lpr -P #{printer_name} #{args} #{file.remote_path}".squeeze " "
54
+ end
55
+ end
56
+
57
+ def check_size file
58
+ if file.size > SIZE_LIMIT
59
+ warning SIZE_WARNING % [file.size.to_human]
60
+ false
61
+ else
62
+ true
63
+ end
64
+ end
65
+
66
+ def check_working
67
+ unless @options[:force]
68
+ command = "lpq -P #{@printer_name}"
69
+ output = @session.exec!(command)
70
+ print_jobs = output.split("\n").length - 2
71
+
72
+ if (print_jobs > JOB_LIMIT) || !(output =~ /is not ready/).nil?
73
+ error "#{@printer_name} isn't doing too well at the moment. Try another printer."
74
+ return false
75
+ else
76
+ return true
77
+ end
78
+ end
79
+ true
80
+ end
81
+ end
82
+ end
@@ -1,3 +1,3 @@
1
1
  module Oode
2
- Version = VERSION = '0.1.6'
2
+ Version = VERSION = '0.2.0'
3
3
  end
@@ -0,0 +1 @@
1
+ oode(1) oode.1.ronn
data/man/oode.1 CHANGED
@@ -1,98 +1,79 @@
1
- .\" generated with Ronn/v0.5
2
- .\" http://github.com/rtomayko/ronn/
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "OODE" "1" "May 2010" "XOEBUS" "Oode Manual"
4
+ .TH "OODE" "1" "April 2011" "Lolsoft" "Oode Manual"
5
5
  .
6
6
  .SH "NAME"
7
- \fBoode\fR \-\- print from a laptop to an AT printer
7
+ \fBoode\fR \- work with DICE from a laptop
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBoode\fR [\fIOPTIONS\fR] \fIFILE\fR...
11
- .
12
- .br
10
+ \fBoode\fR [\fIGLOBAL OPTIONS\fR] \fICOMMAND\fR [\fIOPTIONS\fR] \fIFILE\fR\.\.\.
13
11
  .
14
12
  .SH "DESCRIPTION"
15
- \fBoode\fR makes printing to the printers in Appleton Tower much easier
16
- from laptops by automating some of the tediousness from the sequence
17
- of tasks required.
13
+ \fBoode\fR is a program that simplifies working with the DICE network from a laptop in Appleton Tower\. As of the current version \fBoode\fR is able to print to any of the printers on the DICE network with more functionality in the near future\.
18
14
  .
19
15
  .SH "SAMPLE USAGE"
20
16
  .
21
17
  .TP
22
- \fBoode \-p at3 file.pdf\fR
23
- Print \fBfile.pdf\fR to the printer \fBat3\fR.
24
- .
25
- .TP
26
- \fBoode \-p at13c \-4 \-n 5 file.pdf\fR
27
- Print 5 copies of \fBfile.pdf\fR to printer \fBat13c\fR using the 4\-up layout.
18
+ \fBoode print \-P at3 file\.pdf\fR
19
+ Print the file \fIfile\.pdf\fR to the printer \fIat3\fR\.
28
20
  .
29
21
  .TP
30
- \fBoode \-p at13c \-u s08xxxxx \-a passw0rd file.pdf\fR
31
- Print \fBfile.pdf\fR to \fBat13c\fR as user \fBs08xxxxx\fR authenticating with password \fBpassw0rd\fR.
22
+ \fBoode print \-P at13c \-2 \-n 3 file\.pdf\fR
23
+ Print \fI3\fR copies of the file \fIfile\.pdf\fR to the printer \fIat3\fR in the \fItwo\-up\fR page layout\.
32
24
  .
33
25
  .SH "CONFIGURATION"
34
- \fBoode\fR can read SSH authentication usernames and passwords from a
35
- configuration file so you don't have to type them in every time. A
36
- file called \fB.ooderc\fR should be placed in your home directory with
37
- the following contents:
38
- .
39
- .IP "" 4
40
- .
41
- .nf
42
-
43
- :user: <username>
44
- :password: <password>
45
- .
46
- .fi
26
+ \fBoode\fR can read SSH authentication usernames and passwords from a configuration file so you don\'t have to type them in every time\.
47
27
  .
48
- .IP "" 0
28
+ .P
29
+ The following command will create the file \fB~/\.ooderc\fR that contains global options so that you don\'t have to type them each time\.
49
30
  .
50
31
  .P
51
- Either of these can be missed if you would rather enter them yourself
52
- each time.
32
+ \fBoode \-u s0xxxxxx \-p passw0rd initconfig\fR
53
33
  .
54
- .SH "OPTIONS"
55
- The following options and flags can be used with \fBoode\fR:
34
+ .P
35
+ Either of these can be omitted if you would rather enter them yourself each time or you can specify them at the command line like above for individual commands\.
56
36
  .
57
- .SS "Authentication"
37
+ .SS "GLOBAL OPTIONS"
58
38
  .
59
39
  .TP
60
- \fB\-u\fR, \fB\-\-user\fR=\fIUSERNAME\fR
61
- Your DICE username so that \fBoode\fR can authenticate.
40
+ \fB\-u\fR, \fB\-\-username\fR=\fIUSERNAME\fR
41
+ Your DICE username so that \fBoode\fR can authenticate\.
62
42
  .
63
43
  .TP
64
- \fB\-a\fR, \fB\-\-password\fR=\fIPASSWORD\fR
65
- Your DICE password so that \fBoode\fR can authenticate.
44
+ \fB\-p\fR, \fB\-\-password\fR=\fIPASSWORD\fR
45
+ Your DICE password so that \fBoode\fR can authenticate\.
66
46
  .
67
- .SS "Miscellaneous"
47
+ .SH "COMMANDS"
48
+ The following options and flags can be used with \fBoode\fR:
49
+ .
50
+ .SS "Print"
68
51
  .
69
52
  .TP
70
- \fB\-p\fR, \fB\-\-printer\fR=\fIPRINTER\fR
71
- Use the printer, \fIPRINTER\fR, to print the \fIFILES\fR.
53
+ \fB\-P\fR, \fB\-\-printer\fR=\fIPRINTER\fR
54
+ Use the printer, \fIPRINTER\fR, to print the \fIFILES\fR\.
72
55
  .
73
56
  .TP
74
57
  \fB\-f\fR, \fB\-\-force\fR
75
- Force \fBoode\fR to use a certain printer even if it is not desired.
76
- .
77
- .SS "Printing"
58
+ Force \fBoode\fR to use a certain printer even if it is not desired\.
78
59
  .
79
60
  .TP
80
61
  \fB\-n\fR, \fB\-\-number\fR=\fINUMBER\fR
81
- Print \fINUMBER\fR copies of the \fIFILES\fR.
62
+ Print \fINUMBER\fR copies of the \fIFILES\fR\.
82
63
  .
83
64
  .TP
84
- \fB\-2\fR, \fB\-\-two\-up\fR
85
- Print the files in the 2\-up style.
65
+ \fB\-2\fR, \fB\-\-two\fR
66
+ Print the files in the 2\-up style\.
86
67
  .
87
68
  .TP
88
- \fB\-4\fR, \fB\-\-four\-up\fR
89
- Print the files in the 4\-up style.
69
+ \fB\-4\fR, \fB\-\-four\fR
70
+ Print the files in the 4\-up style\.
90
71
  .
91
72
  .SH "BUGS"
92
- \fIhttp://github.com/xoebus/oode/issues\fR
73
+ \fIhttp://github\.com/xoebus/oode/issues\fR
93
74
  .
94
75
  .SH "AUTHOR"
95
- Chris Brown :: cb@tardis.ed.ac.uk :: @xoebus
76
+ Chris Brown :: cb@tardis\.ed\.ac\.uk :: @xoebus
96
77
  .
97
78
  .SH "SEE ALSO"
98
- \fIhttp://github.com\fR, \fIhttp://github.com/xoebus/oode\fR
79
+ \fIhttp://github\.com\fR, \fIhttp://github\.com/xoebus/oode\fR
@@ -2,151 +2,167 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
- <meta name='generator' value='Ronn/v0.5'>
6
- <title>oode(1) -- print from a laptop to an AT printer</title>
7
- <style type='text/css'>
8
- body {margin:0}
9
- #man, #man code, #man pre, #man tt, #man kbd, #man samp {
10
- font-family:consolas,monospace;
11
- font-size:16px;
12
- line-height:1.3;
13
- color:#343331;
14
- background:#fff; }
15
- #man { max-width:89ex; text-align:justify; margin:0 25px 25px 25px }
16
- #man h1, #man h2, #man h3 { color:#232221;clear:left }
17
- #man h1 { font-size:28px; margin:15px 0 30px 0; text-align:center }
18
- #man h2 { font-size:18px; margin-bottom:0; margin-top:10px; line-height:1.3; }
19
- #man h3 { font-size:16px; margin:0 0 0 4ex; }
20
- #man p, #man ul, #man ol, #man dl, #man pre { margin:0 0 18px 0; }
21
- #man pre {
22
- color:#333231;
23
- background:#edeceb;
24
- padding:5px 7px;
25
- margin:0px 0 20px 0;
26
- border-left:2ex solid #ddd}
27
- #man pre + h2, #man pre + h3 {
28
- margin-top:22px;
29
- }
30
- #man h2 + pre, #man h3 + pre {
31
- margin-top:5px;
32
- }
33
- #man > p, #man > ul, #man > ol, #man > dl, #man > pre { margin-left:8ex; }
34
- #man dt { margin:0; clear:left }
35
- #man dt.flush { float:left; width:8ex }
36
- #man dd { margin:0 0 0 9ex }
37
- #man code, #man strong, #man b { font-weight:bold; color:#131211; }
38
- #man pre code { font-weight:normal; color:#232221; background:inherit }
39
- #man em, var, u {
40
- font-style:normal; color:#333231; border-bottom:1px solid #999; }
41
- #man h1.man-title { display:none; }
42
- #man ol.man, #man ol.man li { margin:2px 0 10px 0; padding:0;
43
- float:left; width:33%; list-style-type:none;
44
- text-transform:uppercase; font-size:18px; color:#999;
45
- letter-spacing:1px;}
46
- #man ol.man { width:100%; }
47
- #man ol.man li.tl { text-align:left }
48
- #man ol.man li.tc { text-align:center;letter-spacing:4px }
49
- #man ol.man li.tr { text-align:right }
50
- #man ol.man a { color:#999 }
51
- #man ol.man a:hover { color:#333231 }
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>oode(1) - work with DICE from a laptop</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ <style type='text/css' media='print'>
45
+ /* style: print */
46
+ .mp {max-width:none}
47
+ .man-navigation {display:none !important}
48
+ .mp a[href]:not([href^="#"]):not([data-bare-link]):after {content:" " attr(href)}
49
+ </style>
50
+ <style type='text/css' media='all'>
51
+ /* style: toc */
52
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
53
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
54
+ .man-navigation a:hover {color:#111;text-decoration:underline}
52
55
  </style>
53
56
  </head>
54
- <body>
55
- <div id='man'>
56
-
57
- <h1 class='man-title'>oode(1)</h1>
58
-
59
- <ol class='head man'>
60
- <li class='tl'>oode(1)</li>
61
- <li class='tc'>Oode Manual</li>
62
- <li class='tr'>oode(1)</li>
63
- </ol>
64
-
65
- <h2 id='NAME'>NAME</h2>
66
- <p><code>oode</code> -- print from a laptop to an AT printer</p>
67
-
68
- <h2>SYNOPSIS</h2>
69
-
70
- <p><code>oode</code> [<var>OPTIONS</var>] <var>FILE</var>...<br /></p>
71
-
72
- <h2>DESCRIPTION</h2>
73
-
74
- <p><code>oode</code> makes printing to the printers in Appleton Tower much easier
75
- from laptops by automating some of the tediousness from the sequence
76
- of tasks required.</p>
77
-
78
- <h2>SAMPLE USAGE</h2>
57
+ <!--
58
+ The following styles are deprecated and will be removed at some point:
59
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
60
+
61
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
62
+ .man-navigation should be used instead.
63
+ -->
64
+ <body id='manpage'>
65
+ <div class='mp' id='man'>
66
+
67
+ <div class='man-navigation' style='display:none'>
68
+ <a href="#NAME">NAME</a>
69
+ <a href="#SYNOPSIS">SYNOPSIS</a>
70
+ <a href="#DESCRIPTION">DESCRIPTION</a>
71
+ <a href="#SAMPLE-USAGE">SAMPLE USAGE</a>
72
+ <a href="#CONFIGURATION">CONFIGURATION</a>
73
+ <a href="#COMMANDS">COMMANDS</a>
74
+ <a href="#BUGS">BUGS</a>
75
+ <a href="#AUTHOR">AUTHOR</a>
76
+ <a href="#SEE-ALSO">SEE ALSO</a>
77
+ </div>
78
+
79
+ <ol class='man-decor man-head man head'>
80
+ <li class='tl'>oode(1)</li>
81
+ <li class='tc'>Oode Manual</li>
82
+ <li class='tr'>oode(1)</li>
83
+ </ol>
84
+
85
+ <h2 id="NAME">NAME</h2>
86
+ <p class="man-name">
87
+ <code>oode</code> - <span class="man-whatis">work with DICE from a laptop</span>
88
+ </p>
89
+
90
+ <h2 id="SYNOPSIS">SYNOPSIS</h2>
91
+
92
+ <p><code>oode</code> [<var>GLOBAL OPTIONS</var>] <var>COMMAND</var> [<var>OPTIONS</var>] <var>FILE</var>...</p>
93
+
94
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
95
+
96
+ <p><code>oode</code> is a program that simplifies working with the DICE network from
97
+ a laptop in Appleton Tower. As of the current version <code>oode</code> is able to
98
+ print to any of the printers on the DICE network with more functionality
99
+ in the near future.</p>
100
+
101
+ <h2 id="SAMPLE-USAGE">SAMPLE USAGE</h2>
79
102
 
80
103
  <dl>
81
- <dt><code>oode -p at3 file.pdf</code></dt><dd><p> Print <code>file.pdf</code> to the printer <code>at3</code>.</p></dd>
82
- <dt><code>oode -p at13c -4 -n 5 file.pdf</code></dt><dd><p> Print 5 copies of <code>file.pdf</code> to printer <code>at13c</code> using the 4-up layout.</p></dd>
83
- <dt><code>oode -p at13c -u s08xxxxx -a passw0rd file.pdf</code></dt><dd><p> Print <code>file.pdf</code> to <code>at13c</code> as user <code>s08xxxxx</code> authenticating with password <code>passw0rd</code>.</p></dd>
104
+ <dt><code>oode print -P at3 file.pdf</code></dt><dd><p> Print the file <em>file.pdf</em> to the printer <em>at3</em>.</p></dd>
105
+ <dt><code>oode print -P at13c -2 -n 3 file.pdf</code></dt><dd><p>Print <em>3</em> copies of the file <em>file.pdf</em> to the printer <em>at3</em> in the
106
+ <em>two-up</em> page layout.</p></dd>
84
107
  </dl>
85
108
 
86
109
 
87
- <h2>CONFIGURATION</h2>
110
+ <h2 id="CONFIGURATION">CONFIGURATION</h2>
88
111
 
89
112
  <p><code>oode</code> can read SSH authentication usernames and passwords from a
90
- configuration file so you don't have to type them in every time. A
91
- file called <code>.ooderc</code> should be placed in your home directory with
92
- the following contents:</p>
93
-
94
- <pre><code>:user: &lt;username>
95
- :password: &lt;password>
96
- </code></pre>
113
+ configuration file so you don't have to type them in every time.</p>
97
114
 
98
- <p>Either of these can be missed if you would rather enter them yourself
99
- each time.</p>
115
+ <p>The following command will create the file <code>~/.ooderc</code> that contains
116
+ global options so that you don't have to type them each time.</p>
100
117
 
101
- <h2>OPTIONS</h2>
118
+ <p> <code>oode -u s0xxxxxx -p passw0rd initconfig</code></p>
102
119
 
103
- <p>The following options and flags can be used with <code>oode</code>:</p>
120
+ <p>Either of these can be omitted if you would rather enter them yourself
121
+ each time or you can specify them at the command line like above for
122
+ individual commands.</p>
104
123
 
105
- <h3>Authentication</h3>
124
+ <h3 id="GLOBAL-OPTIONS">GLOBAL OPTIONS</h3>
106
125
 
107
126
  <dl>
108
- <dt><code>-u</code>, <code>--user</code>=<var>USERNAME</var></dt><dd><p> Your DICE username so that <code>oode</code> can authenticate.</p></dd>
109
- <dt><code>-a</code>, <code>--password</code>=<var>PASSWORD</var></dt><dd><p> Your DICE password so that <code>oode</code> can authenticate.</p></dd>
127
+ <dt><code>-u</code>, <code>--username</code>=<var>USERNAME</var></dt><dd><p> Your DICE username so that <code>oode</code> can authenticate.</p></dd>
128
+ <dt><code>-p</code>, <code>--password</code>=<var>PASSWORD</var></dt><dd><p> Your DICE password so that <code>oode</code> can authenticate.</p></dd>
110
129
  </dl>
111
130
 
112
131
 
113
- <h3>Miscellaneous</h3>
114
-
115
- <dl>
116
- <dt><code>-p</code>, <code>--printer</code>=<var>PRINTER</var></dt><dd><p> Use the printer, <var>PRINTER</var>, to print the <var>FILES</var>.</p></dd>
117
- <dt><code>-f</code>, <code>--force</code></dt><dd><p> Force <code>oode</code> to use a certain printer even if it is not desired.</p></dd>
118
- </dl>
132
+ <h2 id="COMMANDS">COMMANDS</h2>
119
133
 
134
+ <p>The following options and flags can be used with <code>oode</code>:</p>
120
135
 
121
- <h3>Printing</h3>
136
+ <h3 id="Print">Print</h3>
122
137
 
123
138
  <dl>
139
+ <dt><code>-P</code>, <code>--printer</code>=<var>PRINTER</var></dt><dd><p> Use the printer, <var>PRINTER</var>, to print the <var>FILES</var>.</p></dd>
140
+ <dt><code>-f</code>, <code>--force</code></dt><dd><p> Force <code>oode</code> to use a certain printer even if it is not desired.</p></dd>
124
141
  <dt><code>-n</code>, <code>--number</code>=<var>NUMBER</var></dt><dd><p> Print <var>NUMBER</var> copies of the <var>FILES</var>.</p></dd>
125
- <dt><code>-2</code>, <code>--two-up</code></dt><dd><p> Print the files in the 2-up style.</p></dd>
126
- <dt><code>-4</code>, <code>--four-up</code></dt><dd><p> Print the files in the 4-up style.</p></dd>
142
+ <dt><code>-2</code>, <code>--two</code></dt><dd><p> Print the files in the 2-up style.</p></dd>
143
+ <dt><code>-4</code>, <code>--four</code></dt><dd><p> Print the files in the 4-up style.</p></dd>
127
144
  </dl>
128
145
 
129
146
 
130
- <h2>BUGS</h2>
147
+ <h2 id="BUGS">BUGS</h2>
131
148
 
132
- <p><a href="http://github.com/xoebus/oode/issues">http://github.com/xoebus/oode/issues</a></p>
149
+ <p><a href="http://github.com/xoebus/oode/issues" data-bare-link="true">http://github.com/xoebus/oode/issues</a></p>
133
150
 
134
- <h2>AUTHOR</h2>
151
+ <h2 id="AUTHOR">AUTHOR</h2>
135
152
 
136
153
  <p>Chris Brown :: cb@tardis.ed.ac.uk :: @xoebus</p>
137
154
 
138
- <h2>SEE ALSO</h2>
155
+ <h2 id="SEE-ALSO">SEE ALSO</h2>
139
156
 
140
- <p><a href="http://github.com">http://github.com</a>,
141
- <a href="http://github.com/xoebus/oode">http://github.com/xoebus/oode</a></p>
157
+ <p><a href="http://github.com" data-bare-link="true">http://github.com</a>, <a href="http://github.com/xoebus/oode" data-bare-link="true">http://github.com/xoebus/oode</a></p>
142
158
 
143
159
 
144
- <ol class='foot man'>
145
- <li class='tl'>XOEBUS</li>
146
- <li class='tc'>May 2010</li>
147
- <li class='tr'>oode(1)</li>
148
- </ol>
160
+ <ol class='man-decor man-foot man foot'>
161
+ <li class='tl'>Lolsoft</li>
162
+ <li class='tc'>April 2011</li>
163
+ <li class='tr'>oode(1)</li>
164
+ </ol>
149
165
 
150
- </div>
166
+ </div>
151
167
  </body>
152
168
  </html>