Skip to content

Commit

Permalink
Strip unfinished features
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancelotbronner committed May 11, 2023
1 parent 60c5769 commit cd8489c
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 828 deletions.
2 changes: 0 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ let package = Package(
targets: [
.target(name: "CTermios"),
.target(name: "Termios", dependencies: ["CTermios"]),

.testTarget(name: "TermiosTests", dependencies: ["Termios"]),
]
)
23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
# Terminal
# Termios

This package aims to aid in the making of Command-Line Applications by providing an API to wrap
ANSI commands.

The package contains a few modules: `Termios`, `ControlSequence`, `Prompt` and `Terminal`. The last one re-exports all previous ones.
Swift wrapper around `termios.h`

*Any help, comments or suggestions would be welcome!*

## Termios

A swift termios wrapper, with documentation from the man pages.

## ControlSequence

Wraps ANSI sequences, string styling shortcuts, terminal query sequences and parsing, etc.

## Prompt

Alternative to readline, provides a plugin architecture to customize your prompt

## Terminal

Provides convenience APIs for terminal-related things
80 changes: 0 additions & 80 deletions Sources/Termios/Control+.swift

This file was deleted.

25 changes: 5 additions & 20 deletions Sources/Termios/Control.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,61 +9,46 @@ import Darwin.POSIX.termios

extension termios {

/// See ``Termios/Termios/size``
@inlinable public var csize: Int32 {
get { get(mask: CSIZE, from: c_cflag) }
set { set(mask: CSIZE, to: newValue, in: &c_cflag) }
}

/// See ``isTwoStopBitsUsed``
@inlinable public var cstopb: Bool {
get { get(flag: CSTOPB, from: c_cflag) }
set { set(flag: CSTOPB, to: newValue, in: &c_cflag) }
}

/// See ``isParityEnabled``
@inlinable public var cread: Bool {
get { get(flag: CREAD, from: c_cflag) }
set { set(flag: CREAD, to: newValue, in: &c_cflag) }
}

@inlinable public var parenb: Bool {
get { get(flag: PARENB, from: c_cflag) }
set { set(flag: PARENB, to: newValue, in: &c_cflag) }
}

/// See ``parity-swift.property``
@inlinable public var parodd: Bool {
get { get(flag: PARODD, from: c_cflag) }
set { set(flag: PARODD, to: newValue, in: &c_cflag) }
}

/// See ``isReadEnabled``
@inlinable public var cread: Bool {
get { get(flag: CREAD, from: c_cflag) }
set { set(flag: CREAD, to: newValue, in: &c_cflag) }
}

/// See ``isHangUpOnLastCloseEnabled``
@inlinable public var hupcl: Bool {
get { get(flag: HUPCL, from: c_cflag) }
set { set(flag: HUPCL, to: newValue, in: &c_cflag) }
}

/// See ``isModemStatusLineMonitoringEnabled``
@inlinable public var clocal: Bool {
get { get(flag: CLOCAL, from: c_cflag) }
set { set(flag: CLOCAL, to: newValue, in: &c_cflag) }
}

/// Currently unused, same as ``crtscts``
@inlinable public var ccts_oflow: Bool {
get { get(flag: CCTS_OFLOW, from: c_cflag) }
set { set(flag: CCTS_OFLOW, to: newValue, in: &c_cflag) }
}

/// Currently unused, same as ``ccts_oflow``
@inlinable public var crtscts: Bool {
get { get(flag: CRTSCTS, from: c_cflag) }
set { set(flag: CRTSCTS, to: newValue, in: &c_cflag) }
}

/// See ``isFlowControlledByCarrier``
@inlinable public var mdmbuf: Bool {
get { get(flag: MDMBUF, from: c_cflag) }
set { set(flag: MDMBUF, to: newValue, in: &c_cflag) }
Expand Down
Loading

0 comments on commit cd8489c

Please sign in to comment.