Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1016316 // platformQuoteOpt - quote stuff for platform-specific command line if necessary

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (8204L/46K).

1  
static S platformQuoteOpt(S s) {
2  
  ret empty(s) || containsUnsafePlatformCmdLineChar(s) ? platformQuote(s) : s;
3  
}
4  
5  
static S platformQuoteOpt(File f) {
6  
  ret platformQuoteOpt(f2s(f));
7  
}
8  
9  
sS platformQuoteOpt(O o) {
10  
  if (o cast File) ret platformQuoteOpt(o);
11  
  ret platformQuoteOpt(strOrEmpty(o));
12  
}

Author comment

Began life as a copy of #1005009

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1016316
Snippet name: platformQuoteOpt - quote stuff for platform-specific command line if necessary
Eternal ID of this version: #1016316/4
Text MD5: 46157d2e78534d41ec9b33044caa9f4d
Transpilation MD5: 89cab4b61269fd172f8c247fb0f9e056
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-22 18:24:59
Source code size: 308 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 414 / 492
Version history: 3 change(s)
Referenced in: [show references]