private static int Main(string[] args) { try { var parser = new CommandLineParser <LPRMJob>(); var job = parser.ParseCommandLine(args); IPrintClient lprClient = new PrintClient(); var task = lprClient.CancelAsync(job); task.Wait(); } catch (ParserException) { Console.WriteLine("Remove job from a remote lpd queue."); Console.WriteLine(); Console.WriteLine("Usage: lprm -Sserver -Pprinter -Jid"); Console.WriteLine(); Console.WriteLine("Options:"); Console.WriteLine(" -S server Name or ipaddress of the host providing lpd service"); Console.WriteLine(" -P printer Name of the print queue"); Console.WriteLine(" -J id Id of the job"); Console.WriteLine(); Console.WriteLine(); return(1); } catch (Exception e) { Console.WriteLine(e); return(2); } return(0); }
static int Main(string[] args) { try { var parser = new CommandLineParser <LPQJob>(); var job = parser.ParseCommandLine(args); IPrintClient lprClient = new PrintClient(); var task = lprClient.QueryPrinterAsync(job); foreach (var line in task.Result) { Console.WriteLine(line); } } catch (ParserException) { Console.WriteLine("Displays the state of a remote lpd queue."); Console.WriteLine(); Console.WriteLine("Usage: lpq -Sserver -Pprinter [-l]"); Console.WriteLine(); Console.WriteLine("Options:"); Console.WriteLine(" -S server Name or ipaddress of the host providing lpd service"); Console.WriteLine(" -P printer Name of the print queue"); Console.WriteLine(" -l verbose output"); Console.WriteLine(); Console.WriteLine(); return(1); } catch (Exception e) { Console.WriteLine(e); return(2); } return(0); }
static int Main(string[] args) { try { var parser = new CommandLineParser <LPRJob>(); var job = parser.ParseCommandLine(args); IPrintClient lprClient = new PrintClient(); var task = lprClient.PrintFileAsync(job); task.Wait(); } catch (ParserException) { Console.WriteLine("Sends a print job to a network printer"); Console.WriteLine(); Console.WriteLine("Usage: lpr -S server -P printer [-C class] [-J job] [-o option] [-x] [-d] filename"); Console.WriteLine(); Console.WriteLine("Options:"); Console.WriteLine(" -S server Name or ipaddress of the host providing lpd service"); Console.WriteLine(" -P printer Name of the print queue"); Console.WriteLine(" -C class Job classification for use on the burst page"); Console.WriteLine(" -J job Job name to print on the burst page"); Console.WriteLine(" -o option Indicates type of the file (by default assumes a text file)"); Console.WriteLine(" Use \"-o l\" for binary (e.g. postscript) files"); Console.WriteLine(" -x Compatibility with SunOS 4.1.x and prior"); Console.WriteLine(" -d Send data file first"); return(1); } catch (Exception e) { Console.WriteLine(e); return(2); } return(0); }